Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 01:29

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Generating Geometry
PostPosted: 14.07.2010, 04:10 
Offline

Joined: 14.07.2010, 04:06
Posts: 1
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Generating Geometry
PostPosted: 14.07.2010, 05:49 
Offline

Joined: 21.08.2008, 11:44
Posts: 354
interfect wrote:
Where is the format documented?
Horde3D Data Format Reference


Top
 Profile  
Reply with quote  
 Post subject: Re: Generating Geometry
PostPosted: 17.07.2010, 21:03 
Offline

Joined: 21.12.2008, 23:46
Posts: 23
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group