Sagewire Logo

3D Terrain

3 Message(s) by 2 Author(s) originally posted in 3d java


From: Dave Date:   Monday, April 10, 2006
I want to create a 3d map so that you can see roads and elevation (i.e.
terrain... so you can see hills). What object s should I use in the JAVA3d
hierarchy to achieve this?

My terrain will obviously consist of a bunch of triangles. How do I
implement such a triangle using JAVA3d?

Any advice'd be appreciated.


From: =?ISO-8859-15?Q?Nick_Wiedenbr=FCck?= Date:   Thursday, April 13, 2006
Hi Dave,

you can use the GeometryInfo class to create the
triangular mesh. Say, you've the vertices v1, v2, v3
of each triangle, each with its own elevation value
h1, h2, h3. First create an array of these vertices

Point3f coordinates = new Point3f[number of points];

and fill it with the Points of the triangles (triangle
after triangle)

Point3f(v1.x, v1.y, h1)
Point3f(v2.x, v2.y, h2)
Point3f(v3.x, v3.y, h3)

After that, create a GeometryInfo object:

GeometryInfo ginfo = new GeometryInfo(GeometryInfo.TRIANGLE_ARRAY);
ginfo.setCoordinates(coordinates);

Then create normals by

NormalGenerator ng = new NormalGenerator();
ng.createNormals(ginfo);and finally a Shape3D object:

Shape3D terrain = new Shape3D(ginfo.getGeometryArray());

If you want you can manipulate the model's appearance by
creating an Appearance object an manipulate it:

Appearance terrainAppearance = new Appearance();
... manipulate Appearance object ...
terrain.setAppearance(terrainAppearance);Then you can add your terrain object to a TransformGroup.

Remark: To my knowledge it is impossible to create a triangular
mesh with a TRIANGLE_STRIP_ARRAY

Bye,
Nick


From: Dave Date:   Thursday, April 13, 2006
wrote in message

Hi Dave,
you can use the GeometryInfo class to create the
triangular mesh. Say, you've the vertices v1, v2, v3
of each triangle, each with its own elevation value
h1, h2, h3. First create an array of these vertices
Point3f coordinates = new Point3f[number of points];
and fill it with the Points of the triangles (triangle
after triangle)
Point3f(v1.x, v1.y, h1)
Point3f(v2.x, v2.y, h2)
Point3f(v3.x, v3.y, h3)
After that, create a GeometryInfo object:
GeometryInfo ginfo = new GeometryInfo(GeometryInfo.TRIANGLE_ARRAY);
ginfo.setCoordinates(coordinates);
Then create normals by
NormalGenerator ng = new NormalGenerator();
ng.createNormals(ginfo);
and finally a Shape3D object:
Shape3D terrain = new Shape3D(ginfo.getGeometryArray());
If you want you can manipulate the model's appearance by
creating an Appearance object an manipulate it:
Appearance terrainAppearance = new Appearance();
... manipulate Appearance object ...
terrain.setAppearance(terrainAppearance);
Then you can add your terrain object to a TransformGroup.
Remark: To my knowledge it is impossible to create a triangular
mesh with a TRIANGLE_STRIP_ARRAY



Thanks! Very helpful answer.



Next Message: JAVA3D on Linux RH Enterprise 2.4


Blogs related to 3D Terrain

General :: RE: ! ! DOWNLOAD ThE MOST POPULAR 2006's CRACKED ...
BLUEBERRY.3D.TERRAIN.TOOLS.V1.0 [2CD] BLUEBERRY.3D.DEVELOPMENT.ENVIROMENT. ... Java.Edition.v4.71.22 [1CD] MapInfo.MapXtreme.Java.Edition.v4.71.22. ... SiteBuilder 3D v1.02 for ArcView 3.x [1CD] MULTIGEN.PARADIGM.CREATOR.TERRAIN.STUDIO. ...

Cartesian vs. Polar Coordinates Moving and Rotating Polygons
Plan of Attack Building an Action Environment Simulating 3D Understanding Sprite Theory Writing the Code Implementing Sprite.java Variables Defining Sprite IDs Initializing the Variables Defining the Sprite Images Animating the Sprites ...

Professional cracked software for all users
DESIGN.3D.V6.13 for Windows [1CD] OidView.Professional.v2.1.74 PAM-Crash.v2001 [1CD] PDESolutions. ... BLUEBERRY.3D.TERRAIN.TOOLS.V1.0 [2CD] ... OPEN INVENTOR FOR JAVA V4.0 [1CD] TGS.Open Inventor v4.0 for Visual C++.NET 7.1 [1CD] ...

Sports Games 3D Golf Game Air Hockey Air Hockey Air Hockey Classic ...
Jetix 3D Soccer; Jurassic Putt; King Putt; Lightning Break; Mani Golf ... Java Tetris; JetPack; Jump n Glide; Jungle Escape; Jungle Master; Knockers; Kumkang ... Terrain Chapter 1; The Game; The Hulk; Thief; Thin Ice; Tiger Moth ...

Top 5 essencial games for N-Gage
... they’re better than most slowish and some times pixelated java games. ... like defending terrain, ambushing troops, destroying bunkers and attacking. ... Available for free at the N-Gage web site, it’sa 3D snake remake with new ...

Xj3D v1.0 browser, developer library and test environment
... and to handle large multi-resolution terrain databases. ... ECMAScript and Java scripting capabilities: X3D provides developers with interfaces to both ECMAScript and Java programs to allow greater degrees of flexibility in creating ...


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional