Open GoogleCodeExporter opened 8 years ago
Do you mean vertex coordinates of a mesh or the coordinates from picked
positions?
Original comment by Humu2...@gmail.com
on 16 Jan 2014 at 5:18
I mean the coordinates from picked positions.
on the other hand I would appreciate also if you could explain how to get the
vertex coordinates.
thanks
Original comment by carles.h...@gmail.com
on 16 Jan 2014 at 8:34
There's not an existing method to get coordinates from a picked position
directly. While this can be done by:
1. Use viewer.pick()
method(http://jsc3d.googlecode.com/svn/trunk/jsc3d/docs/symbols/JSC3D.Viewer.htm
l#pick) to fetch the transformed coords on a given position (pickInfo.canvasX,
pickInfo.canvasY, pickInfo.depth);
2. The transformation matrix is stored in viewer.transformMatrix as a 3x4
matrix. You can manually solve its inverse matrix, by which to calculate the
coords of that picked position in model space.
Getting vertex coordinates is quite straightforward. A mesh's vertex coords are
stored in its vertexBuffer property in a flattened sequece as x0, y0, z0, x1,
y1, z1, .... Just Access mesh.vertexBuffer to get them.
Original comment by Humu2...@gmail.com
on 18 Jan 2014 at 3:53
I'll try it,
thanks for your support.
Original comment by carles.h...@gmail.com
on 18 Jan 2014 at 3:12
is there no simpler way to get the x and y coordinates during runtime?
i would like to execute a function at some given positions during the animation.
Original comment by wolfmar...@gmail.com
on 20 Mar 2014 at 10:20
Original issue reported on code.google.com by
carles.h...@gmail.com
on 16 Jan 2014 at 11:14