Vector3D.project();

By skid | Jul 4, 2009

actionscript3

I’m working with the CS4 3D functions and I find them pretty good, but there are some things I can not understand.

Take a look at my example: http://labs.ovidiu.ch/3d/1/
(move your mouse to the corners of the screen to rotate it)

Notice that the object is not projected linear, but somehow curved… as if the object is bending. That might look like a cool effect :), but it looks like this by mistake.

The thing is, the object is not formed by 4 vertexes, because then it would look linear, how I want it too, but rather from a lot more. Every point where the lines I drawn meet is another vertex (for other animating purposes).

Now the thing that actually makes it look like this is the project part, and it looks something like this:

ActionScript Code:
vectors[i].w = perspective / vectors[i].z + perspective); vectors[i].project();

Still, even if with more vertexes, it should look linear, unless the projection is incorrect.

So I found this in the Adobe documentation:

Quote:

The project() method then can complete the projection by dividing the elements by the w property. Use the Matrix3D.rawData property to create a projection Matrix3D object.


Does any of you have any idea how could I use the Matrx3D.rawData property to create a projection?

Btw, I’m creating everything from AS. I’m using drawTriangles to draw the content between the vertexes.

Thanks.

actionscript3

Please reply at our Forum

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

© 2007 ActionScript 3.0