Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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 1881 times)
0 Members and 1 Guest are viewing this topic.
Offline SimonH
« Posted 2012-04-15 05: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 12: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 16: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 16: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
« League of Dukes »

JGO Overlord


Medals: 742
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #4 - Posted 2012-04-27 16: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 16: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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

ctomni231 (34 views)
2014-07-18 06:55:21

Zero Volt (30 views)
2014-07-17 23:47:54

danieldean (25 views)
2014-07-17 23:41:23

MustardPeter (27 views)
2014-07-16 23:30:00

Cero (42 views)
2014-07-16 00:42:17

Riven (44 views)
2014-07-14 18:02:53

OpenGLShaders (32 views)
2014-07-14 16:23:47

Riven (32 views)
2014-07-14 11:51:35

quew8 (30 views)
2014-07-13 13:57:52

SHC (66 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org 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‑gaming.org
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!