Camera handling like Google Sketchup

Software: Away3D 3.x

Avatar
Bas, Newbie
Posted: 19 September 2011 09:12 AM   Total Posts: 23

Hello everyone,

I’m trying to create the camera handling just like in Google Sketchup or somewhat similar. Rotating and moving the model around in the view.
To have the camera zoom in and rotate around the clicked position i have the camera look at an invisible target sphere.

Despite my efforts i can’t figure out the right settings for my camera, it doesn’t behave like i would like.

Does anybody know how to get things right?? Or steer me in the right direction?

   

Avatar
Alejandro Santander, Administrator
Posted: 20 September 2011 03:03 AM   Total Posts: 414   [ # 1 ]

This is a camera controller I use for quick testing: https://github.com/lidev/litools-fp10/blob/master/com/li/litools/camera/OrbitCameraController.as

It should give you a rough idea of what to do. For this kind of motion I like to use spherical coordinates to cartesian coordinates translation, so that I can guarantee that the distance from the target to the camera is not disturbed.

   

Avatar
Bas, Newbie
Posted: 22 September 2011 08:38 AM   Total Posts: 23   [ # 2 ]

Hello everybody

Yesterday i found a bit of code that almost did the trick for me.

The only thing i still have to fix is the rotation around the Y-axis.
So if someone knows how, i tried using the tilt and pan angles with a hovercamera3d but that didn’t work.

But moving the model around and rotating around the X- and Z-Axis works as i wanted it to work.
Thanks to “Miroku” who posted the bit of code on pastebin.

http://pastebin.com/zcjrFrWn

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X