Hi all,
When I move the mouse on my sceen I want to display the (x,y,z)
co-ordinates on my scene on the status bar. I tried to do it this
way, but it doesnt seem to give me the right position. Since my
object is placed at (0.5, 0.0, 0.0), but then it gives me
somethign like (0.2, -0.3, -0.04) approx. Can somebody please
tell me if I am doing it right, I am not very good with vector
calculations :-)
This is a part of my behavior
--------------------------------------------------------------
public void updateScene(int xpos, int ypos)
{
pickShape = pickObject.generatePickRay(xpos, ypos);
pickRay = (PickRay) pickShape;
pickRay.get(initial, direction);
destination.add(initial, direction);
Double x_coord = new Double(destination.x);
Double y_coord = new Double(destination.y);
Double z_coord = new Double(destination.z);
textField.setText("(" + x_coord.floatValue() + " , " +
y_coord.floatValue() + " , " + z_coord.floatValue()+ ")");
}
--------------------------------------------------------------
Please help me !
Thanks in advance
Tina
Tina Manoharan
Work: Home:
------ ------
Heriot Watt University , PhD 89 Lothian Road
Dept. of Computing & Electrical Eng. Flat: 3f1
Riccarton, Edinburgh EH14 4AS Edinburgh EH3 9AW
Ph: 0131 449 5111 ext. 4197 (lab) Ph: 07801 069485 (mobile)
Ph: 0131 449 5111 ext. 4191 (office) Ph: 07740 959483 (mobile)
Ph: 0044 131 477 9043
===========================================================================
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".