Page 1 of 1

creating procedural geometry

Posted: Sat Sep 09, 2017 10:30 pm
by slapin
Hi, all!

I want to implement what I did for Urho3D and Godot

https://www.youtube.com/watch?v=KoYLlYmWVxA

i.e. procedural roadmap + buildings (but on different level, i.e. not 90 degrees angles and different building styles will be
implemented. Where should I start?
I do have all the algorithms implemented already, I just need to have engine-specific hooking.
1. How can I implement procedural geometry for buildings with LODs. The buildings should be enterable and with
interiors.
2. How such code is best integrated into engine, i.e. where to look for hooking that in?
3. Later I will want to have procedural terrain generation, where to look how this is done?
4. How can I store generated geometry in save file so it generates everything on New game and then everything persists throughout playthrough?

Thanks!

Re: creating procedural geometry

Posted: Sat Sep 09, 2017 11:12 pm
by Duion
Anything that is like a road can use the road tool, you just add nodes and it will generate a road to there.
Simple geometry can use the sketch tool maybe.
Terrain can also be modified realtime, but the size cannot change.

But a whole building that can be entered is very complicated, you would need some code that generates a regular 3D model.
The LOD part I would leave out since that is too complicated for now.

Re: creating procedural geometry

Posted: Sun Sep 10, 2017 2:48 am
by slapin
That is my actual question - how can I generate 3D model at runtime?

Re: creating procedural geometry

Posted: Sun Sep 10, 2017 9:39 am
by Duion
I would search the old garagegames forum, especially the resources, since often people have already done it and I think to remember mutiple people doing this already.
Or look up the sourcecode in classes that already generate geometry, like terrain, ground plane, clouds, sketch tool, mesh road tool, collision mesh generator in shape editor etc etc there are already a lot of places where that happens.

Re: creating procedural geometry

Posted: Sun Sep 10, 2017 12:36 pm
by LukasPJ
You can find examples of different rendering methods here:
https://github.com/GarageGames/Torque3D ... D/examples

This file in particular:
https://github.com/GarageGames/Torque3D ... xample.cpp
shows how to render a hard-coded cube. In order to do it procedurally, you would feed it your procedurally generated vertices.

This is only for rendering, you would have to add to that in order to get collision working.