Hi:
Sorry , bother you again, thanks to check this mail.
I had trouble about calculate a 2D coordinate of any 3D vertex by myself.
I listed the result what I got step by step , please check it where it is wrong.
Thanks again.
 
Greg
------------------------------------------------------------------------------------
1.Picked a geometry in 3D environiment , and then got their coordinates:
Vertices 1:(-337.7125244140625, -39.0, 557.6038818359375)
Vertices 2:(-338.5674743652344, 52.0, 557.0851440429688)
Vertices 3:(-278.7225646972656, -44.0, 589.3093872070312)
Vertices 4:(-278.7225646972656, 59.0, 589.3093872070312)
2.Because the viewplatform had been rotated about y-axis, I got the transform matrix:( I had modified this transform matrix for geometry other than for viewplatform )
-0.8476782808170698, 0.0, -0.5305106334759154, 0.0
0.0, 1.0, 0.0, 0.0
0.5305106334759154, 0.0, -0.8476782808170698, 0.0
0.0, 0.0, 0.0, 1.0
 
3.transform every vertex by rotation matrix:
v1 X:-9.5432 Y:-39.0000 Z:-651.8288
v2 X:-8.5433 Y:52.0000 Z:-651.8426
v3 X:-76.3678 Y:-44.0000 Z:-647.4101
v4 X:-76.3678 Y:59.0000 Z:-647.4101

4.Got the Vworld projection matrix from Canvas3D and transform vertices. I didn't sure this step is necessary, because I didn't understand the meaning of this matrix.And, I had another question here, when I saw the documention, it says that this transform takes points in virtual world coordinates and projects them into clipping coordinates, which are in the range [-1,1] in X, Y, and Zbut I got the result its x value more than 1:
v1 X:1.2016 Y:-0.1415 Z:0.7615
v2 X:1.1987 Y:0.1887 Z:0.7622
v3 X:1.3859 Y:-0.1597 Z:0.7081
v4 X:1.3859 Y:0.2141 Z:0.7081
5.Transform the vertices to image plate coordinate by the matrix returned by getVworldToImagePlate().
v1 X:0.0208 Y:0.1296 Z:-0.0006
v2 X:0.0210 Y:0.1535 Z:-0.0007
v3 X:0.0116 Y:0.1283 Z:0.0098
v4 X:0.0116 Y:0.1553 Z:0.0098
 
6. Got pixel location by the method getPixelLocationFromImagePlate().
v1 :(-107.0181817451493, 274.62034930350325)
v2 :(-106.19762194109674, 190.37982225931478)
v3 :(-163.14844039767158, 281.6678047796811)
v4 :(-163.14844039767158, 180.6158981363368)

Obviously, it was not correct, because the x  is negative.
what's wrong in my steps?

Reply via email to