[Logo]
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing  
[Register] Register / 
[Login] Login 
Orbital mode  XML
Forum Index » Alternativa3D 5
Author Message
Joe


Joined: 02/06/2008 03:36:22
Messages: 45
Offline

Is there a way to get the orbital mode with the CameraController like you have on the Alternativa Player?
mike


Joined: 01/06/2008 00:00:06
Messages: 786
Offline

The current version of camera controller doesn't support this mode, but there's possibility to get it. Just put a camera inside of another camera and translate the inner camera along negative direction of Z axis, then assign parent camera to a controller and the inner camera to a view. The controller will rotate the parent camera and the inner camera will orbiting around center of the outer one. I must admit, it is a bit weird way to make a camera orbit, but for now there's no other option (except writing your own controller of course). There's a good chance that in the next update of 5.0 version will be new controller with extended functionality including orbital mode.

This message was edited 1 time. Last update was at 17/08/2008 11:47:00

Joe


Joined: 02/06/2008 03:36:22
Messages: 45
Offline

Cool trick. Works well

I created it into a class (OrbitCamera3D) for anyone interested in using it before the next lib update:


Useage:


It's contains the CameraController, so call this before you call Scene3D.calculate() :


You can also change its focalPoint but calling lookAt or changing its focalPointX, focalPointX, focalPointZ.

Heres my example

-Joe

This message was edited 2 times. Last update was at 07/11/2008 00:35:11

mukherjee78


Joined: 28/10/2008 14:31:34
Messages: 2
Offline

Have anyone encountered the mouse wheel issue ?
When ever you scroll the mouse wheel the orbit code is freezing []
Joe


Joined: 02/06/2008 03:36:22
Messages: 45
Offline

Yes, I just noticed this too. It looks by default a MouseEvent.MOUSE_WHEEL or MouseEvent3D.MOUSE_WHEEL listener is set. I get this error:


Since I don't have access to the Alternativa3D library source, I think were going to need the help of Team Alternativa on this.

So... we need to remove default mouseWheel event, or even better, tie it to my OrbitCamera3D.distance property.
mike


Joined: 01/06/2008 00:00:06
Messages: 786
Offline

Just use WalkController, it hasn't mouse wheel support
mukherjee78


Joined: 28/10/2008 14:31:34
Messages: 2
Offline

Hats off [] it worked []
Joe


Joined: 02/06/2008 03:36:22
Messages: 45
Offline

Yeah, that worked, but now the focalPointX, focalPointY, focalPointZ, and lookAt(), don't work... What am I missing here?? Here is the update with the WalkController update:

This message was edited 2 times. Last update was at 26/11/2008 22:50:14

mike


Joined: 01/06/2008 00:00:06
Messages: 786
Offline

Walk controller overrides an object's coordinates now. You should use the "coords" property of a controller instance.
Joe


Joined: 02/06/2008 03:36:22
Messages: 45
Offline

I tried that, but it still doesn't render the new angle when changing the controller's coords? This is what I tried:

It didn't have a problem moving until I switched it to the WalkController to get rid of the mouseWheel error... Is the WalkController making it immobile? If I know how to disable the CameraController's mouseWheel event, I could resolve this...

This message was edited 3 times. Last update was at 26/11/2008 22:55:14

mike


Joined: 01/06/2008 00:00:06
Messages: 786
Offline

In this case controller.coords acts as a getter and returns an instance of Point3D. To change x coordinate you have to set a new value for x in this instance and assign it back to "coords". I know, this isn't that convenient as simply setting x, y, z via separate properties, but this is how it's working right now.
Joe


Joined: 02/06/2008 03:36:22
Messages: 45
Offline

OK, now its working Thanks Mikhail. Here is the final OrbitCamera3D for anyone who wants to use it:

asmalkov


Joined: 03/05/2009 12:18:27
Messages: 1
Offline

What if we add



to the buildController() method and also add



to enable mouse wheel zooming?
 
Forum Index » Alternativa3D 5
Go to:   
Powered by JForum 2.1.8 © JForum Team