Jump to content
  • Advertisement
Sign in to follow this  
ProgrammingNerd

couple of questions on octrees

This topic is 4890 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!