Skip to main content
gamedev.net
🔒 Locked

Octree

Started by OleKaiwalker 3 replies 500+ views
Original Post
OleKaiwalker
OleKaiwalker
When using a Octree in opengl for a big world with models and other non-static things within, is it a good idea to include those in the Octree? When I think about both pros and cons with it... Pros -> The models will not be drawn! Collision Detection will be easier! Cons -> One will have to recalculate the octree every frame I would like to hear what you have to say about this subject...
UltimaX
UltimaX
>>The models will not be drawn!<<
Regular frustrum culling will handle that

>>Collision Detection will be easier!<<
? If its not in the frustrum don''t check for collisions. If it is, check the bounding sphere. If the bounding sphere is being collided with, handle the collision as normal or go furthur to the face level.

Pros ->
None... Not with dynamic objects

>>One will have to recalculate the octree every frame<<
As you know, slowwwwww.

Cons ->
Slow




Possible solution?
Use an octree for the static objects and for the dynamic objects, look into collision maps or something. Or use a quadtree, quadtree would work real good come to think of it
Anybody else? Don''t listen to me, I''m no pro. I just give suggestions

-UltimaX-

"You wished for a white christmas... Now go shovel your wishes!"
theZapper
theZapper
From above:

>>Collision Detection will be easier!<<
? If its not in the frustrum don't check for collisions.

I'm sure you would still need to check for collisions with moving objects outside the viewing frustrum. Even though you can't see somthing moving, doesn't nesessarily mean it doesn't exist anymore. For example, a missile flying past you, what if it is suppsed to hit a wall just behind you and explode, but you just ignore it, you won't recieve the correct amount of damage and your game will be unrealistic. And what if you run backwards, you'll run through stuff!

---
"When I'm in command, every mission's a suicide mission" - Zapp Branigan

[edited by - theZapper on July 19, 2003 7:22:40 AM]
---When I'm in command, every mission's a suicide mission!
Waverider
Waverider
Correct.

Collision detection should take place everywhere in the game world unless you have some faster way of handling the collisions outside of the frustum that has the same result.

Effects that have no impact on the game world, such as smoke, particles, the stance of a complex 3D figure, etc. would not need to be calculated or rendered outside the frustum.

However, if a 3D figure had a weapon hardpoint on the end of his arm, and it was trying to fire a weapon, that would need to be calculated no matter where it is if you are going for accurate representation.
It's not what you're taught, it's what you learn.
TSwitch
TSwitch
You don''t need to recalculate an octree every frame, just the stuff that moved across node boundaries.
Member of the Unban nes8bit or the White Rhino in my Basement Gets Sold to the Highest Bidder Association (UNWRBGSHBA - Not accepting new members.)Member of the I'm Glad Mithrandir Finally Found an Association that Accepts People with his Past History Association (IGMFFAAPPHA)

Topic Locked

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

Sign in to reply to this topic.