[Papervision3D] yaw getting reset when tweening with Papervision3D AS3

Paddy Keane Paddy.Keane at wai.co.uk
Fri Sep 7 10:14:00 PDT 2007


Hi Guys,

I'm having problems when tweening properties of a papervision3d DisplayObject3D. It seems to reset the 'yaw' value ;( Anyone have any ideas how I could fix this?

Example:
http://www.darklump.co.uk/experiments/papervision3d/as3/tweenerTest.html

Source:
http://www.darklump.co.uk/experiments/papervision3d/as3/tweenerTest.fla

click on stage.
Result: when tweening starts the sphere's yaw is reset causing it to jump to a different position. I'm pretty new to papervision3d and tweener. I have an inkling that the transform matrix of the DisplayObject3D is getting wiped. Can anyone help?


[CODE]

import flash.events.Event;
import flash.events.MouseEvent;

import org.papervision3d.*;	
import org.papervision3d.events.*;	
import org.papervision3d.materials.*;	
import org.papervision3d.objects.*;	
import org.papervision3d.scenes.*
import org.papervision3d.cameras.*;

import caurina.transitions.Tweener;

var canvas:Sprite = new Sprite();
addChild(canvas);
canvas.x = stage.stageWidth*.5;
canvas.y = stage.stageHeight*.5;

var scene:Scene3D = new Scene3D(canvas);

stage.addEventListener(Event.ENTER_FRAME, handleEnterFrame); scene.container.stage.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownEvent);

var sphereContainer:DisplayObject3D = new DisplayObject3D("sphereContainer");

var clr:ColorMaterial = new ColorMaterial(0x00ff00);
var sphere:Sphere = new Sphere(clr, 200, 10, 10);
sphere.x = 1250;
sphereContainer.addChild(sphere);

// rotate around center axis
sphereContainer.yaw(90);

scene.addChild(sphereContainer);

var camera:Camera3D = new Camera3D(sphereContainer);

camera.z = -1000000;
camera.y = 500000;
camera.zoom = 1500;

function handleEnterFrame(e:Event):void
{
	scene.renderCamera(camera);
}

function mouseDownEvent(e:MouseEvent):void {
	Tweener.addTween(sphereContainer, {scale:.1, y:-2000, time:2, transition:"easeoutquad"});
}

[/CODE]

Ta paddy ;)

 Paddy.Keane
 Creative Director
 Digital Solutions Team
 World Archipelago
 3rd Floor, Octagon House
 81-83 Fulham High Street
 London SW6 3JW
 Tel: +44 (0)20 7471 8330 (main)
 Fax: +44 (0)20 7471 8331
 Blog: http://www.darklump.co.uk
 Web: http://www.worldarchipelago.com
 Map: http://www.worldarchipelago.com/map/



More information about the Papervision3D mailing list