How can I determine pixel coordinates for a location in Virtual
World ?

For example for the sceneGraph drawn below I would  like to get the pixel coordinates 
of the sphere center(assuming it's (0,0,0) in local coordinate system)

                            VU
                        /        \
                    BG        V(View)
                    /
                TG1
                /
            TG2
            /
        SPHERE

I compute Local2World matrix and the inverse of  the view matrix. Then I
multiply them to
form Local2View matrix: (M stands for matrix for a particular node)

M(result) = M(V.invert())*M(Local2World)     where M(Local2World) =
M(TG1)*M(TG2)

Next step is to compute the position of the center of the sphere in view coordinate 
system :
Vector3d loc2View = M(result)*(0,0,0,1) (which turns out to be the translation part of 
M(result))

Then I call getVworld2ImagePlate() function to transform loc2View to imagePlane 
coordinate system.

getVworld2ImagePlate()
Vector3d imagePl = t.transform(local2View)

In the final step I call getPixelLocationFromImagePlane() for imagePl vector(actually 
Point3d) function but unfortunately the result is different from  what mousePress 
event reports.

What's wrong with this idea ?

Thanks in advance

--Tom





-------------------------------------
Mieszkanie za 600 zł miesięcznie! Skorzystaj z oferty Nordea Bank  Polska S.A. 
Szczegóły na stronie http://www.nordeabank.pl/ lub pod 0801  667 332.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to