Hi,
Be warned - this is a long one! But I desperately need help.....
I am writing my degree project which is a 3D shape manipulator in Java 3D
and I have hit a major brick wall and could do with some help asap!
I have most of the code written except the code for manipulating
individual points inside a Shape3D. The program uses primitive instancing
of various types of Shape3D which have point3d lists and face lists etc. I
am using the Pick***behaviour objects for translation, rotation and
zooming and I was wondering if writing my own behaviour object would be
the best way to do this? If so how do you go about writing one?
Presumably I need to have a mouselistener to listen for a masked click -
say a shift click - then use a pickray to find which shape is under the
mouse, use it again to find a near vertex and then trap a drag and apply
this change to the vertex via a method of the shape3d. I have several
problems though.
1) How do I get AWT screen coordinates into VirtualUniverse coordinates?
2) Once I use the pickray to get the path to the object and ultimately the
object itself, how do I then determine if any vertex is within a
certain distance of the mouse (via the ray)?
3) Finally, once that's done - how do I then trap any drags while the
button is down and then apply them to the vertex? Can I edit the vertex
while the shape is in the scene graph or do I need to pop it out, edit
it and then push it back in again?
4) Oh and how will I make this interface nicely with PickRotate, PickZoom
and PickTranslate because as far as I can see PickTranslate traps
anything that the others dont?
Any help would be extremely appreciated as I have been banging my head
about this project for months and my deadlines are scarily close!
Thanks in advance,
Tim.
,----------------------------------------------------------------------.
| Tim Needham. |
| OU Computer Society President. |\ ___,,--,_ __ |
| [EMAIL PROTECTED] /,`--'' \`,,__,',-'|
| http://ox.compsoc.net/~timothy |,4 ) )_ ) /~-----' |
`------------------------------------------'---^~(_/-_)--(_/_)---------'
Q: How many computer scientists does it take to change a light bulb?
A: None. That's a hardware problem, get an engineer!
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/