Java-Gaming.org Hi !
 Featured games (88) games approved by the League of Dukes Games in Showcase (681) Games in Android Showcase (196) games submitted by our members Games in WIP (745) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 Triangulation for Terrains (link)  (Read 857 times) 0 Members and 1 Guest are viewing this topic.

Junior Devvie

Java games rock!

 « Posted 2005-03-14 15:21:03 »

Hi folks,

this link might be usefull for people in need of terrains.

http://astronomy.swin.edu.au/~pbourke/terrain/triangulate/

There is a link to a java version of the code.

What this is good for:

When you need a terrain you will most often start with some sort
of heightfield defined by a 2d matrix of height values.
This works fine for most of the time. But if you want a terrain that is quite large but want to keep poly count low your terrain will become rather ugly because the triangle/quad structure is clearly visible. But if you go for a finer mesh by your 2d heightfield matrix you poly count grows by the square.

The link above provides the algorithm (source) to use the Delauney triangulation of an arbitrary 2d point set. That means that you can use points in arbitrary positions (I think you need to project them to (x,y) to get the algorithm point format). The triangulation method will return a mesh of triangles defined by the points you give it. This is very nice as you can have both sections in your terrain having a very fine mesh while in other locations the mesh can be more chunky (e.g. regions the player can see but not reach). Another advantage is that the terrain can have any type shape (in terms of boundary) in contrast to being constrained by some rectangular matrix type shape.

I got it working but have yet no experience about it's performance or robustness.

Update: haha, the java port omitted the completely unimportant fact that the points supplied have to be sorted by their x coords.

Will this be the last surprise ?

Ca\$
Pages: [1]
 ignore  |  Print

You cannot reply to this message, because it is very, very old.

 CopyableCougar4 (57 views) 2016-06-25 16:56:52 Hydroque (90 views) 2016-06-22 02:17:53 SwampChicken (93 views) 2016-06-20 13:22:57 SwampChicken (95 views) 2016-06-20 13:22:49 SwampChicken (88 views) 2016-06-20 13:22:26 Hydroque (134 views) 2016-06-15 08:22:50 Hydroque (127 views) 2016-06-13 06:40:55 DarkCart (243 views) 2016-05-29 02:30:33 Hydroque (208 views) 2016-05-26 14:45:46 Mac70 (191 views) 2016-05-24 21:16:33
 Spasi 49x theagentd 44x NegativeZero 39x KaiHH 29x LiquidNitrogen 23x princec 21x CoDi^R 16x DavidBVal 15x ra4king 13x ags1 11x Opiop 10x TritonDreyja 9x purenickery 9x Hydroque 8x Archive 8x SHC 8x
 Making a Dynamic Plugin Systemby Hydroque2016-06-25 00:13:25Java Data structures2016-06-13 21:22:09Java Data structures2016-06-13 21:20:42FPS Camera Tutorialby Hydroque2016-05-22 05:40:58Website offering 3D Models specifically for games for freeby vusman2016-05-18 17:23:09Website offering 3D Models specifically for games for freeby vusman2016-05-09 08:50:56Website offering 3D Models specifically for games for freeby vusman2016-05-06 11:10:21Website offering 3D Models specifically for games for freeby vusman2016-04-29 12:56:17
 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