[Papervision3D] Easing Transform Matrix3D

UKLA craig at blueion.com
Tue Feb 17 07:11:20 PST 2009


Yeah, I am using that when the user clicks on a plane within the carousel
do3d in order to transform the carousel so that the clicked plane is facing
the camera.

Click on a plane and it sets these variables:
var radians:Number = (carousel.rotationY - e.displayObject3D.rotationY) *
Quaternion.DEGTORAD;
slerp = 0;
currentQuat = Quaternion.createFromMatrix(carousel.transform);
targetQuat = Quaternion.createFromAxisAngle(0, 1, 0, radians);


function renderData(e:Event):void {
	
	for (var i:uint=0;i<planesArray.length;i++){
		
		lines3d.removeLine(linesArray[i]);
		var line:Line3D = new Line3D(lines3d,lineMaterial,1,new
Vertex3D(planesArray[i].x, planesArray[i].y, planesArray[i].z),new
Vertex3D(planesArray[i].x/4, -200, planesArray[i].z/4))
		lines3d.addLine(line);
		linesArray[i] = line;
	}
	
	
	slerp += (1 - slerp) * .1;
	var quat:Quaternion = Quaternion.slerp(currentQuat, targetQuat, slerp);
 
	carousel.transform = quat.matrix;
	renderer.renderScene(scene, cam, viewport);
}



Not sure how to use this for the mouse dragging in my original post.

Thanks,
Craig



paperworld wrote:
> 
> this sort of thing is traditionally done with Quaternions - you should
> check
> out the slerp implementation in the Quaternion class - i think Andy did a
> blog post recently about a class he wrote for this sort of thing.
> 
> T
> 
> On Tue, Feb 17, 2009 at 2:53 PM, UKLA <craig at blueion.com> wrote:
> 
>>
>> Anyone?
>>
>> -----
>> Craig Anthony
>> Flash Developer
>> http://www.blueion.com Blue Ion, LLC.
>> --
>> View this message in context:
>> http://www.nabble.com/Easing-Transform-Matrix3D-tp22045266p22058851.html
>> Sent from the Papervision3D mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
> 
> 
> 
> -- 
> Trevor Burton
> http://www.flashmonkey.org
> http://www.paperworld3d.com
> http://www.infrared5.com
> 
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> 
> 


-----
Craig Anthony
Flash Developer
http://www.blueion.com Blue Ion, LLC. 
-- 
View this message in context: http://www.nabble.com/Easing-Transform-Matrix3D-tp22045266p22059180.html
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list