Camera movement and Hovercontrol

Software: Away3D 4.x

Mihausen, Newbie
Posted: 23 July 2012 12:59 PM   Total Posts: 5

Hi there,

I’ve got a question regarding the camera control on away4.x.

When clicking on an object I would like the camera to smoothly hover to the object or to a defined place, by pressing again on the object, the camera position shall change as it looks like the camera view is now looking from the object into the room.

I combined the camera with a hovercontroller, by trying to manipulate the camera with .x .y .z or commands like moveTo etc. nothing is happening. Only when I manipulate the hovercontroller I can change the view. What I am doing wrong or is there something I do not understand right ?

When I want to hover to an object, do I need to loop the distance method ?

Thx for any advice,
Mike

   

Richard Olsson, Administrator
Posted: 24 July 2012 08:18 AM   Total Posts: 1192   [ # 1 ]

The hover controller (like all controllers) take control over the object to which you apply them. If you update them every frame, they will set the position of the object (e.g. camera) every frame.

The hover controller specifically is good mostly when you want to “hover” (circulate) around a target object, always pointing towards that object in the center. If that’s not what you want, and it sounds like it might not be in this case, you probably should not be using that controller at all.

If I were you, I would instead try to just implement custom camera logic using a tweening engine. You could perhaps use a LookAtController with a dummy target (e.g. an empty ObjectContainer3D) and tween that independently. That way you can tween both the camera’s position (by tweening the camera) and the invisible target towards which the camera points by tweening the empty ObjectContainer3D.

That will give you full freedom to implement the logic that suits your project.

   

banzai, Newbie
Posted: 24 July 2012 08:52 AM   Total Posts: 9   [ # 2 ]

wait, im creating now this ability

   

Mihausen, Newbie
Posted: 24 July 2012 01:23 PM   Total Posts: 5   [ # 3 ]

Oh thanks for the answer, just found the tweenlite engine, its so amazing and easy to understand. Thanks alot smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X