|
vorodis2, Newbie
Posted: 05 March 2013 04:05 PM Total Posts: 22
I have a point in ObjectContainer3D, and need to know where that point on the 2d.
|
Fabrice Closier, Administrator
Posted: 05 March 2013 04:44 PM Total Posts: 1265
[ # 1 ]
Look at project and unproject methods in View3D or Camera3D.
|
vorodis2, Newbie
Posted: 06 March 2013 09:24 AM Total Posts: 22
[ # 2 ]
Thank you. But this half woes.
As I understand it, this method shows the position of the point relative to 3d Camera3D. It is excellent. But I have this point in ObjectContainer3D/ObjectContainer3D/ObjectContainer3D/Vector3d ()
and on each of ObjectContainer3D from applying a large number of transformations (scale, rotation, pozitionXYZ). What would cause my point of Camera3D I should apply to it, all these transformations. Maybe there is what that is ready algorithm or function.
|
vorodis2, Newbie
Posted: 07 March 2013 03:51 PM Total Posts: 22
[ # 3 ]
v0 - point in view.scene
v1 = word3d.view.unproject(v0.x,v0.y,v0.z);
How true use.
It issued that is not clear.
|
Fabrice Closier, Administrator
Posted: 07 March 2013 04:37 PM Total Posts: 1265
[ # 4 ]
you can use Matrix3D transformvector method using the container transform matrix3d if its a point in space or if you want the position of one of the object in these container. use mesh.scenePosition instead of position.
You also can take a look at Drag3D class in tools, where the unproject is being used.
|
geekay, Jr. Member
Posted: 07 March 2013 07:21 PM Total Posts: 40
[ # 5 ]
vorodis2 - 05 March 2013 04:05 PM I have a point in ObjectContainer3D, and need to know where that point on the 2d.
If you are using Away3D 4.1, you can use:
//view is your View3D object //obj is the ObjectContainer3D view.project(obj.scenePosition);
This will give you a 3D vector, and the X and the Y properties in that will give you the position on the screen your object is.
|
vorodis2, Newbie
Posted: 08 March 2013 11:27 AM Total Posts: 22
[ # 6 ]
|
geekay, Jr. Member
Posted: 08 March 2013 07:39 PM Total Posts: 40
[ # 7 ]
No problemo, happy coding!
|