katopz / jsc3d

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

Get x,y,z from client #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
I would get the coordinates x, y, z from the client at runtime. I have not been 
able to find any method. 

I'm looking for a method to get the same result that I have obtained with 
zoomFactor. 

txtZoomfactor.value = viewer.zoomFactor 

thanks

thanks

What version of the product are you using? On what operating system?
1.6.5 
Windows 

Please provide any additional information below.

Original issue reported on code.google.com by carles.h...@gmail.com on 16 Jan 2014 at 11:14

GoogleCodeExporter commented 9 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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
I'll try it,

thanks for your support.

Original comment by carles.h...@gmail.com on 18 Jan 2014 at 3:12

GoogleCodeExporter commented 9 years ago
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