Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (686)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Triangulating contour data  (Read 2418 times)
0 Members and 1 Guest are viewing this topic.
Offline SimonH
« Posted 2012-04-15 03:13:52 »

So there's a 2.5D game made of 3D tiles which fit seamlessly together (at various LOD).
Here's a contour map of a single tile;

The task is to use this 256x256 image to create low and high-poly meshes - so what's the best approach?

People make games and games make people
Offline DzzD
« Reply #1 - Posted 2012-04-15 10:08:36 »

One thought would be to use something like ROAM but not sure that it is the best for contour

here an old applet with source code

EDIT : you can imediatly test the result by converting your contour image in blue gradiant and test it with the above applet

Offline SimonH
« Reply #2 - Posted 2012-04-15 14:48:12 »

That's a nice piece of kit, but it doesn't really do what I want;

Ideally the poly vertices would lie on the contour lines so I can apply the correct texture.
Here's a partial sketch of what I'd like to get to for the high-poly version;

(The low-poly version would only use the contours bordering different terrain types).
My current plan is to walk the contour lines, breaking them into line segments as I go, then use the segments to somehow generate triangles. A bit vague! Maybe I should just use the end-points of the line segments as vertices and use *gulp* Delaunay triangulation?

People make games and games make people
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SimonH
« Reply #3 - Posted 2012-04-27 14:10:33 »

Well, I got there in the end;

If you want a quick 'n' easy Delaunay triangulator check here.
It's not 100% perfect in this context but is hopefully good enough.
I think I'd describe this task as 'non-trivial'!

People make games and games make people
Offline Riven

« JGO Overlord »

Medals: 1068
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #4 - Posted 2012-04-27 14:36:09 »

If you're going to interpolate normals, those long, narrow triangles will become a PITA. To completely work around this problem, use normalmaps.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline DzzD
« Reply #5 - Posted 2012-04-27 14:56:37 »

If you're going to interpolate normals, those long, narrow triangles will become a PITA. To completely work around this problem, use normalmaps.

IMHO, I am not sure it is necessary to use normalmaps, you can get smooth result with normal interpolation by using the angle of the two edges of the triangle that touch the vertex as a weights on computation of the resulting normal. It usually give good results.

(also maybe I would rather consider a lighting/shadow map (and disable light on rendering if not requiered), as it is easy/fast to compute/update in 2d for land/terrain and can also be used to cast other object shadow)

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (68 views)
2015-11-07 13:29:08

Rems19 (77 views)
2015-10-31 01:36:56

Rems19 (70 views)
2015-10-31 01:32:37

williamwoles (104 views)
2015-10-23 10:42:59

williamwoles (91 views)
2015-10-23 10:42:45

Jervac_ (105 views)
2015-10-18 23:29:12

DarkCart (132 views)
2015-10-16 00:58:11

KaiHH (115 views)
2015-10-11 14:10:14

KaiHH (154 views)
2015-10-11 13:26:18

BurntPizza (167 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!