Getting a plane normal in 4.0

Software: Away3D 4.x

xynsei, Newbie
Posted: 26 December 2012 07:48 PM   Total Posts: 10

What tile says - is there a property like Mesh.{something}.faces[0].normal ? Or i have to calculate it myself? I am interested in PlaneGeometry specifically.

Thanks.

   

xynsei, Newbie
Posted: 26 December 2012 08:06 PM   Total Posts: 10   [ # 1 ]

Could http://away3d.com/livedocs/away3d/4.0/away3d/core/base/Object3D.html#forwardVector be what i’m looking for? Seems to do the job.

   

Rasterizer, Member
Posted: 27 December 2012 09:40 AM   Total Posts: 69   [ # 2 ]

I don’t see what an OBJECT’s FORWARD VECTOR has to do with a NORMAL VECTOR of one of its FACES…

   

xynsei, Newbie
Posted: 28 December 2012 01:12 PM   Total Posts: 10   [ # 3 ]

Not really good at geometry but like i said - interested in plane specifically so plane.forwardVector = plane.faces[any].normal because all the faces are on same plane? Or i am wrong about that? I would still love to get an answer on how to get normal for a face but plane forward vector seems to be working for my needs so far.

   

CoderBob, Newbie
Posted: 28 December 2012 11:20 PM   Total Posts: 1   [ # 4 ]

Well, as it is derived from higher-order classes, and it doesn’t contain the geometry data itself, one of its parents has to have the geometry contained within or linked from somewhere.

For PlaneGeometry, the inheritance order is PlaneGeometry -> PrimitiveBase -> Geometry. As it is public, you should be able to access the subGeometry vector from either the PrimitiveBase parent or the Geometry grandparent.

More here: http://away3d.com/livedocs/away3d/4.0/away3d/primitives/PrimitiveBase.html#subGeometries

Alternately, if you can determine 3 points on the plane, you can easily do some 3D math and get the normal vector.

http://www.opengl.org/wiki/Calculating_a_Surface_Normal

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X