Jump to content


- - - - -

Physics & Scene Management with DirectX


5 replies to this topic

#1 MarekKnows.com

    Valued Member

  • Members
  • PipPipPip
  • 190 posts
  • LocationOntario, Canada

Posted 09 March 2006 - 02:49 PM

I'm using DX9c to create my game engine... however I'm a little confused what to do about scene management.

How should I organize all my objects in the game. Is there any good scene management software out there? What about Physics. I need something that will work with the scene management easily so that I can do collision detection and other fun stuff like that.

What are people using out there when you use DirectX?
C++, 3D OpenGL and Game Programming video tutorials:
www.MarekKnows.com
Play my free games: Ghost Toast, Zing

#2 karligula

    Valued Member

  • Members
  • PipPipPip
  • 180 posts

Posted 10 March 2006 - 08:42 PM

collision detection is FUN?

you're mad ;-)

#3 kulik

    Member

  • Members
  • PipPip
  • 41 posts

Posted 11 March 2006 - 10:20 AM

Look at the open source engines source for some scene graph and scene managing implementation (OpenSceneGraph, Ogre, CrystalSpace, ..).

Basically you want something called SceneGraph, in SceneGraph you have Nodes, attached to each other. You attach anything renderable to the nodes. When you move node, every subnode and attached renderables move too. Same applies to rotation or any other transformation.

When you outline this, you can try to implement a Octree optimization. Octree will build octane tree using attached renderables.

Physics is a little tricky, because the standard culling techniques aren't applicable to physics. I solve it this way:
1) using std techniques to render (Octrees)
2) using physics scene optimizations parallel (got BruteForce - no culling, and basics of some sort of tree - scene divided into little boxes, collisions only happens from one body to bodies in neighbour boxes)

btw: I know I can collide using octree, however I think this approach is much more flexible than constraining physics to rendering scene managers ...

@karligula: I agree, collision and physics is fun, but only when it has been already implemented and you're watching the result ;)
The Eleventh - completely open source RPG game
Tenuity3D - cross-platform OpenGL game engine

#4 MarekKnows.com

    Valued Member

  • Members
  • PipPipPip
  • 190 posts
  • LocationOntario, Canada

Posted 11 March 2006 - 12:07 PM

Do you know if there is any good documentation for OpenSceneGraph, Ogre, or CrystalSpace explaining how the scene management stuff works.

I'm not very good at taking code and trying to figure out what it's for.

Just to clairify, you are using a scene graph to store all the data in your game, and another scene graph just for your physics?

I'm a little confused with the octrees bit. Are you saying your scene graph IS an octree?
C++, 3D OpenGL and Game Programming video tutorials:
www.MarekKnows.com
Play my free games: Ghost Toast, Zing

#5 roel

    Senior Member

  • Members
  • PipPipPipPip
  • 698 posts

Posted 11 March 2006 - 03:58 PM

I wouldn't consider a scene graph as an octree. A scene graph describes the logical relations between objects (a chair is in a house is in a village ...) (or an axe is attached to the left hand of the player). An octree is a spatial data structure that is often used for frustum culling, like: give me all the objects that are inside the frustum.

http://www.gamedev.n...topic_id=110342
http://www.gamedev.n...topic_id=128965
http://www.gamedev.n...topic_id=181233

#6 kulik

    Member

  • Members
  • PipPip
  • 41 posts

Posted 11 March 2006 - 09:36 PM

I think I didn't made that clear, octree != scene graph, octree is created using scene graph. octree isn't used for scene management, but just for optimizations. I hope it's clearer now ;)
The Eleventh - completely open source RPG game
Tenuity3D - cross-platform OpenGL game engine





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users