creating procedural geometry

Expanding and utilizing the engine via C++.
5 posts Page 1 of 1
slapin
Posts: 21
Joined: Thu Aug 10, 2017 12:56 am
by slapin » Sat Sep 09, 2017 10:30 pm
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!
Duion
Posts: 805
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sat Sep 09, 2017 11:12 pm
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.
slapin
Posts: 21
Joined: Thu Aug 10, 2017 12:56 am
by slapin » Sun Sep 10, 2017 2:48 am
That is my actual question - how can I generate 3D model at runtime?
Duion
Posts: 805
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Sep 10, 2017 9:39 am
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.
LukasPJ
Site Admin
Posts: 348
Joined: Tue Feb 03, 2015 7:25 pm
 
by LukasPJ » Sun Sep 10, 2017 12:36 pm
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.
5 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest