NOT working. Flash 10 player has been updated to official release.
Requires Flash 10 (currently beta)
http://labs.adobe.com/downloads/flashplayer10.html
Demo of rotating cube(partial to see culling effect):
http://psalmhundred.net/experiment/flash3d/Flash10App.html
Thursday, June 19, 2008
Flash 10 3D API - Utils3D.projectVectors(...)
Utils3D.projectVectors(m:Matrix3D, verts:Vector, projectedVerts:Vector, uvts:Vector) causes Flash player 10 beta to crash currently.
so just a workaround, a custom method to do similar thing:
public function projectVectors(projMatrix:Matrix3D, vert:Vector.<Number>,
v2D:Vector.<Number>, uvt:Vector.<Number>):void{
var temp:Vector.<Number> = new Vector.<Number>(vert.length);
projMatrix.transformVectors(vert, temp);
var z:Number = 0;
for(var i:int = 0; i<temp.length/3; i++){
z = temp[i*3+2];
z = focalLength / (focalLength+z);
// x' = f*x/(f+z), y' = f*y/(f+z)
v2D[i*2] = temp[i*3]*z;
v2D[i*2+1] = temp[i*3+1]*z;
// t = f/(f+z)
uvt[i*3+2] = z;
}
}
so just a workaround, a custom method to do similar thing:
public function projectVectors(projMatrix:Matrix3D, vert:Vector.<Number>,
v2D:Vector.<Number>, uvt:Vector.<Number>):void{
var temp:Vector.<Number> = new Vector.<Number>(vert.length);
projMatrix.transformVectors(vert, temp);
var z:Number = 0;
for(var i:int = 0; i<temp.length/3; i++){
z = temp[i*3+2];
z = focalLength / (focalLength+z);
// x' = f*x/(f+z), y' = f*y/(f+z)
v2D[i*2] = temp[i*3]*z;
v2D[i*2+1] = temp[i*3+1]*z;
// t = f/(f+z)
uvt[i*3+2] = z;
}
}
Subscribe to:
Posts (Atom)