brlrt / away3d

Automatically exported from code.google.com/p/away3d
0 stars 0 forks source link

[Broomstick] convert 3D coordinates of Vertice, to 2D coordinates #177

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Previously on Away a simple use of screenvertex

var screenVertex0:ScreenVertex = 
camera.screen(objec3d,(plane.geometry.vertices[0] as Vertex)) as ScreenVertex;
var x0:Number = screenVertex0.x+stage.stageWidth/2;
var y0:Number = screenVertex0.y+stage.stageHeight/2;

this were giving me the exact position of my vertice (Vector3D)
on the 2D coordinates

Now it's a bit tricker, using 

camera.viewProjection.clone();
sceneTransform.clone();
var pv:Vector3D = Utils3D.projectVector(camT, new Vector3D());

but all this is not giving me the exact position of my vertices

here is an example with a cube, but for me I need the 2 cornes of a plane !!
http://www.vatrobot.de/molehill_broomstick/HelloCube_VertexPoint2D.html

Original issue reported on code.google.com by can...@gmail.com on 25 Apr 2011 at 11:45