Skip to main content
GameDev.net gamedev.net
🔒 Locked

Octrees on terrain...

Started by ff8 Aug 8, 2006 at 5:35 PM 3 replies 1.2k views
Original Post
ff8
ff8
Hello everyone , i made terrain class for my engine and it works great but it was kinda slow so i decide improving it so i started reading about Octrees algorithm it was easy to understand but when i started to implement it on the terrain xD it was hard for me to cut it in to cubes ;_; can anyone tell me how ? another question let's say i have objects in the terrain like trees , rocks etc.. how can i cut complex objects in to cubes ? thank you . cya,
Rasmadrak
Rasmadrak
Hi!

Are you using a heightmap, or a model, as terrain?
if you're using the former, simply let region x,y to x2,y2 be in the corresponding octree.

Regarding objects;
Do not divide complex objects, simply put them in a octree where they fit.
You can also put the object in the octree where the models center is.
"Game Maker For Life, probably never professional thou." =)
DanielH
DanielH
You really should use a quad tree for a terrain instead of an oct tree. It's faster and there's no need for splitting the terrain along the height-axis if it's not a really odd terrain you've got there.
ff8
ff8
@Rasmadrak:
i am using height map.
Quote:

if you're using the former, simply let region x,y to x2,y2 be in the corresponding octree.

can u explain it more ?

@DanielH:
Quad tree =\ first time i heared about it can u give me anygood resource for it ^^?

thank you both ^^.
cya,
rpreller
rpreller
Yah, I would probably use a quadtree for terrain instead of an octree, and some type of occlusion culling if you're walking under the surface, for example.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.