couple of questions on octrees

Started by
3 comments, last by GameMasterXL 18 years, 9 months ago
I have a couple of questions on octrees. I'm using them to split a heightmap into smaller areas for faster rendering/collision detection. First, how can I tell if a certain octree cluster is in front of the player or if it is behind the player. Using this, I can eliminate the need to render anything behind the player, drastically increasing the speed. A 128*128 heightmap only runs at around 70 fps. Second, if I render only some of areas, won't the areas between the clusters be screwed up because the triangles of the cluster won't be connected together. This may not be a problem, as they would be close enough together. If anything is confusing, tell me. Thanks in advance, ProgrammingNerd
Advertisement
Quote:Original post by ProgrammingNerd

First, how can I tell if a certain octree cluster is in front of the player or if it is behind the player. Using this, I can eliminate the need to render anything behind the player, drastically increasing the speed. A 128*128 heightmap only runs at around 70 fps.




Disclaimer: I'm not very good at explaining things...


You should be traversing your tree based on the nodes currently in the viewing frustum....

For example, your first check will the all of the nodes off of your root node. Then you'll want to traverse all of those nodes contained in your root node, checking each node to ensure it's in your frustum, if a node isn't in the frustum, then you can safely break. When you get to a node that has no more children, and is inside of the frustum, you'll render that node.

Quote:Original post by ProgrammingNerd
Second, if I render only some of areas, won't the areas between the clusters be screwed up because the triangles of the cluster won't be connected together. This may not be a problem, as they would be close enough together.


This shouldn't be an issue if your scene is properly divided.

I'd definitely recommend taking a look at the OctTree tutorials on GameTutorials.com.


Hope this helps!
What the hell i can't believe you have to pay for tutorials. Sorry for offtopic but that site seriously needs to drop them prises before many people will go their, look at this site loads of info no prise to pay but that site for a simple trangle turning it costs money.
Quote:Original post by GameMasterXL
What the hell i can't believe you have to pay for tutorials. Sorry for offtopic but that site seriously needs to drop them prises before many people will go their, look at this site loads of info no prise to pay but that site for a simple trangle turning it costs money.


DOH!!!

They used to be free! The octree tutorials were a godsend for helping me learn. hrm...

Edit:
Free Octtree tutorial on GameTutorials

I just dl'd it and gave it a quick once over, it should help!
Wow that site seriously is dear, if anyone pays that site money then they seriously are to easy to get fiddled. What if you pay them the $49.0 dollars just to get a rubish tutorial?

Edit: that info should be made free, NEHE is an excellent site and is 100% free. I bet the people writing the tutorials don't get any of that money.

This topic is closed to new replies.

Advertisement