Camera collision against loaded OBJ

Software: Away3D 4.x

Avatar
mrpinc, Sr. Member
Posted: 07 December 2011 02:49 PM   Total Posts: 119

I’ve been trying to achieve this for a couple days but my results have not been good.

What I am looking for is a way to make sure to limit my camera movement against a a loaded OBJ with a variety of meshes.  I have been able to create a triangle mesh body for my scene object that i want the camera to collide with but I am not sure what the best way to handle camera movement is.

The latest version of Flare3D has a demo Test09_Lights_And_Collisions.as - that loads a f3d (Flare 3D format scene) and automatically sets up all the collisions/movement for you.  It seems to work quite well but I would rather not use Flare as I have been enjoying Away3D so far and it is a far more flexible solution (open source and all)

Anyway, any recommendations on how to achieve what I am looking for would be greatly appreciated.

   

inSertCodE, Sr. Member
Posted: 08 December 2011 01:38 AM   Total Posts: 105   [ # 1 ]

...here is an idea. Tie up the camera movement to an invisible simple primitive (like box or 1x1 plane). Then detect collision of the object, everywhere the object can move, the camera can move. If the object gets on higher ground, the camera gets higher… (hint: hover camera look at inv.primitive)

I’ve build a free moving camera with that principle and by that I’m still able to use the HoverController control over the camera. Something like the camera in RTS, where the camera is not tied to 1 object but rather interacts around the center of the screen, where the center (view position) can be moved. (I hope you get what I mean smile )
However I still haven’t added the collision as other stuff have priorities.

after that you can improve your camera by testing if the view from the camera to the inv.primitive is clear, if not then increase the tilt angle or reduce distance until you get a clear view.

If you want to tie the camera to a player for example, tie the inv.primitive to the player.

   

Fossor, Newbie
Posted: 11 January 2012 11:54 AM   Total Posts: 21   [ # 2 ]

Bump. Can somebody from dev. team tell if there is a plan on making collision detection against complex objects? Or maybe there is a way to do it using current set of tools (partition, traverser…not physics)
Thanx.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X