« Return to Thread: camera.orbit issue.

Re: camera.orbit issue.

by venanmusic :: Rate this Message:

Reply to Author | View in Thread

Hi
This is pv3d GW

goto my website, i´ve got the code there 4 you.
www.andrevenancio.com/teste2/code.zip



Hi,

Thanks very much for the reply.

For some reason, my example just pans the camera around and my planes don't rotate. Do I need to set the camera to lookAt a particular target? What are you camera settings?

Also, is this example using the Great White trunk or 1.5?

Thanks!

venanmusic wrote:
hello.
Actually i think the whitevoid should have a better camera movemente.
so, i did it.
here the planes "look" at he mouse, instead of turning their backs into mouse. lol
sorry my english sucks.

In the render function you should have something like this

addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void {

        var rotY: Number = (mouseY-(stage.stageHeight/2))/(stage.height/2)*(300);
        var rotX: Number = (mouseX-(stage.stageWidth/2))/(stage.width/2)*(-300);
        camera.x= camera.x+(rotX-camera.x)/5;
        camera.y= camera.y+(rotY-camera.y)/5;
       
        renderer.renderScene(scene, camera, viewport);
}

what are u doing? the 1st part of the script(2 lines) you are setting how much distance your planes would have, and where they should turn. try changing the 300 to some other value.
and finally the last 2 lines of code are move the camera, and setting a delay time or a tweener effect. change the value 5 for different speeds.

I think thats all.
u can see a experiment here with this script running:
www.andrevenancio.com/teste2/





Sceneshift wrote:
Hi,

I've just download the latest version of PV2.0 and there seems to be a lot of changes to cameras.

What I am trying to do is create a really simple camera orbit, exactly like this:
http://www.whitevoid.com/application.html

I have tried using camera.orbit and a variety of different mouseXY algorithyms but I can't seem to get anything that resembles that simple "wobble" effect. My planes, viewports are all setup basically so I know its something I am doing with the camera.

Any help appreciates!

 « Return to Thread: camera.orbit issue.