Author Topic:   Is this possible?
posted January 11, 2001 07:44 PM            
Hi guys,
Here is something I was thinking of, not sure if it's possible (as in efficient) or if there is a better method of doing this.

Render CLOD terrain from height map, have other objects on the scene, such as plants, trees etc., plus have objects such as houses, buildings etc. and moving objects, i.e. players etc.

Method 1:
Render the scene in 2 parts.
Part 1:
Use a Quadtree to render the CLOD terrain from the height map. It'll store implicit vertices.

Once the terrain finishes render for that frame move to part 2.
Part 2:
Use an OCTREE to render the objects in the scene. ie. houses, etc. The reason for the switch is, with a quadtree, I can't store things that'll be "above" the 2D terrain field. i.e. even though the terrain is 3D, the 3rd D is just faked by the height map. So objects in the world above it, i.e. not on the height map will need to be stored differently. Now, the scene will be created in an editor, without the terrain, but it'll be created by taking the height at a given part of the terrain into consideration. So basically buildings will be placed in mid air, etc. then when both trees are rendered, it'll look like the house is rendered on "top" of the terrain. Another reason I thought of using OCTREEs is because then I can render volumes, so objects could be on top of each other in layers, i.e. birds flying over trees, etc.

Method 2:
Figure out a way to put the terrain AND the objects all into an OCTREE. Not sure how i'd handle this since only the bottom cubes will have terrain data in them..... and the added height later will be even trickier. Unless the editor reads the terrain, assigns heights, creates a terrain map, which is then used to place objects and the whole thing is then chopped up into an octree, but that defeats the purpose of a CLOD.......

Now, one last part to both these methods is that I think I'll use a BSP tree to render the interiors of the buildings, so from the outside, the outside shell of the house is stored in the octree, but the inside "shell" is stored in a seperate bsp tree, which will be pointed to from the octree....

This may either be 1. nuts, 2. already used and I don't know about it, or 3. might work....

What do you guys think?


posted January 11, 2001 08:54 PM         
I've never used CLODs, Octrees, or BSPs. So my comments probably won't
be that useful.

But anyway, I can speak generally that you want to interact with both
objects and terrain. Well, if I never did this before, I would first try
to keep them separate. Have terrain and objects stored separately in their
own hierarchies. And I would use whatever data structure that is best
for them. Not much of answer, but it's a start.


posted January 11, 2001 09:00 PM            
Ok, assuming we forget about CLOD, octree's and bsp's...
We just have 1 height map and we use a QuadTree to render it. Now, what if we wanted houses sitting on top of that terrain or maybe just a moving object.

I guess the basic question would be,
1. how do you store info, (such as a house), that is outside the area of a height map into that same quadtree?
2. how do you deal with dynamic objects with the same quadtree?

That's the basic issue i'm trying to figure out... the part with octree's was one of the things I thought might work... bsp and clod parts were kinda unrelated to the situation...


posted January 12, 2001 12:31 AM         
1. Objects that don't move usually have static data.
These are buildings, trees, etc.. So they have a position on the
terrain that doesn't change. The only issues I see are things like
determining level of detail and visibility.

2. Objects that move require collision detection with the terrain
and with other objects (enemies, buildings, trees, projectiles, etc..),
along with determining level of detail and visibility.

But how to use this with quadtrees?

I would say a quadtree structure is good for determining visibility.
And that is basically its primary purpose. It's leaves contain the
vertex information you want, so if you can find a vertex by recursing
the quadtree, you can find the height of that vertex with the heightmap.
Since you already know at the lowest resolution, each heightmap coordinate
is a vertex on your terrain. And you can do other things with this
data like collision detection.

Things like level of detail depend on the object's distance from the
camera. You could have 2 or 3 different models with smaller amounts
of vertices and switch between them as the camera gets closer.


New Member
posted October 22, 2001 08:43 PM            
I've never used CLODs, Octrees, Quadtrees, or BSPs and I'm olny programming in VB. So my comments probably won't be that useful.

If you have arrays in c++ what you could do is store all the data in 1, 3 or 4 dementional array as follows:

1st D: x axis, 1 for each square
2nd D: same as first Demention except y axis
3nd D: could have 2 or 3 differnt things.(1 for terrian, 2 for buildinds/trees, and 3 for units)
4th D: (Settings/units on. anything to set)