Horde3D
http://horde3d.org/forums/

SwarmingPathfinder (Procedurally generated geometry example)
http://horde3d.org/forums/viewtopic.php?f=4&t=993
Page 1 of 1

Author:  wakko [ 26.10.2009, 13:59 ]
Post subject:  SwarmingPathfinder (Procedurally generated geometry example)

Actually I do not regard this a a real showcase, but as me and many others are missing some
documentation on how to make Horde3D work with procedurally generated geometry, I decided
to post this to make a start:
This was originally an university task for which we should implement an A* pathfinding demonstrator.
As finding paths through static meshes is boring I decided to write an interactive terrain-generator,
that would allow me to modify my mesh in (almost) real time, to have a dynamic labyrinth.

It's far away from being perfect, but at least it could give some hints on how to work with dynamic
geometry.
Updating the geometry is even worse, but as geometry resources in Horde were read-only until
Horde3D 1.0.0Beta3, it was the only way to do it...
(
- generate internal geometry
- upload to Horde3D
...
- update internal geometry
- unload old geometry from Horde3D
- upload updated geometry to Horde
)

I tried to convert this into a tutorial. It's a lot of code and I hope that it's not too confusing...
Procedurally Generated Geometry Tutorial:
http://www.horde3d.org/wiki/index.php5?title=Procedurally_generated_geometry_tutorial

I really wished that Horde3D had a function like
Code:
/**
 * float size_ the cube's size
 * int r_ red value
 * int g_ green value
 * int b_ blue value
 * int alpha_ transparency
 **/
H3DCreateColoredCube(5.0f, 255, 0, 0, 0);

to create a simple red cube without having to load geometry, texture and shader from files.

[edit] Removed obsolete link

Author:  marciano [ 27.10.2009, 20:54 ]
Post subject:  Re: SwarmingPathfinder (Procedurally generated geometry example)

Thanks a lot for your wiki article! However, I hope that it will soon be a bit easier to create dynamic resources ;)

Author:  johannes [ 09.08.2010, 20:27 ]
Post subject:  Re: SwarmingPathfinder (Procedurally generated geometry example)

marciano wrote:
Thanks a lot for your wiki article! However, I hope that it will soon be a bit easier to create dynamic resources ;)

Has it gotten any easier yet? Or is writing a textstring on the fly to create a .geo-model still the way to go?

I'm all ears for any suggestions. Are there maybe some new functions in trunk that enable me to create a brand new mesh more easily? Or was that already added in Beta4?

Author:  DarkAngel [ 10.08.2010, 15:37 ]
Post subject:  Re: SwarmingPathfinder (Procedurally generated geometry example)

Yeah for procedural content, building a GEO in your app is probably still the best way to go (if you can't do it beforehand, using a tool like the collada-converter...).
Horde is a bit nicer now in that you can update your GEO after you've created it via the new resource API functions.

If you read the file-format description for the GEO format, then making one yourself, or making geometry through a Horde API (which doesn't exist yet) would probably be just as complicated.
i.e. if Horde added an API to help you do this, it would still probably be a complicated process ;)

The code in the wiki is still good, but here's another example of a procedural GEO file if you want it.

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