[Papervision3D] camera.orbit issue.

venanmusic venancio.andre at gmail.com
Fri Jul 18 03:03:09 PDT 2008


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!
> 

-- 
View this message in context: http://www.nabble.com/camera.orbit-issue.-tp18513695p18525627.html
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list