Horde3D
http://horde3d.org/forums/

Generating Geometry
http://horde3d.org/forums/viewtopic.php?f=2&t=1194
Page 1 of 1

Author:  interfect [ 14.07.2010, 04:10 ]
Post subject:  Generating Geometry

I want to generate geometry programatically and feed the result into Horde3D. What format does it have to be in? Where is the format documented?

Edit: I'm using the C# bindings for Beta4. Would a C# port of http://www.horde3d.org/wiki/index.php5? ... y_tutorial be the best way to go? Or is there a better way in Beta4? Or a real writeup of the Horde3D mesh format?

Author:  Siavash [ 14.07.2010, 05:49 ]
Post subject:  Re: Generating Geometry

interfect wrote:
Where is the format documented?
Horde3D Data Format Reference

Author:  wakko [ 17.07.2010, 21:03 ]
Post subject:  Re: Generating Geometry

The procedural geometry tutorial is mostly my own work/fault so I might be able
to give some hints. ;)
Procedural geometry generation first of all requires to manually generate the vertex-, normals- and
UVs-arrays. This can be done in whatever way you like. The number of elements in each array is basically
the same, as long as you are using Vec2(for UVs) and Vec3(for verts and normals).
numVerts == numNormals == numUVs
The most difficut part is to calculate the triangle-indices. This is describedin the "Simple grid"-section.
The REAL difficulties begin when you try to generate asymmetric surfaces, as this could give you
a headache when calculating the indices. ;)
When transforming your vert-/normal-/UV-/triangleIndex values into a Horde compliant stream
you have to keep in mind that the stream wants to have single float values, not Vec2/Vec3 structs,
so you have to use three float values per Vec3 and two per Vec2.
The GeometryStreamGenerator example should be pretty universal, as long as you don't have any
errors in your array-indices. The GeometryStreamGenerator has been developed after an analysis
of the ColladaConverter. You might want to have a look at the ColladaConv sources as well.
Porting this part of the code to C# should not be too much of a problem.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/