David, Some pointers for you.
1. Yes, you can achieve this within Java 3D, and using retained (scenegraph) mode. 2. You need to set the appropriate READ and WRITE capability bits on the Shape3D and GeometryArrays for your Geometry. 3. Then use a Picking Behavior with GEOMETRY-based picking. Once you have a PickResult you can query for the nearest vertex etc. You may want to think about rubber-banding a group of vertices... 4. Once you've selected some vertices you will need to go into "drag mode". While the drag is happening you will need to update the GeometryArray with the positions of the new vertices. You may want to experiment with setting BY_REFERENCE for your GeometryArrays so that you don't have to copy the entire vertex position array to-and-fro while the drag is happening. Check out the sample code from my book for some starting points (particularly building blocks for the behaviors you will need to write). You might also want to look at the skin-and-bones animation example on the www.j3d.org website, it uses dynamic geometry updates for the animation. My particle code (also on www.j3d.org, in the CVS repository) uses BY_REFERENCE geometry updates extensively. Best of luck. Let us know how you get along, and if you can make the "PickingDeformationBehavior" general purpose, and share it with us, all the better! Sincerely, Daniel Selman Author - "Java 3D Programming" http://www.manning.com/selman -----Original Message----- From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]]On Behalf Of David Rush Sent: Thursday, March 21, 2002 4:34 PM To: [EMAIL PROTECTED] Subject: On-the-fly object editing Hi there, This is my first post to this list so i hope you guys can help me out. For my final year project i am implementing a 3D object editor in Java3D. At the mo it can load objects from various file formats using the available loaders, and allows for editing of materials, lights, textures etc. What i am really looking to implement is the ability to dynamically edit the objects by clicking and dragging on the individual vertices. I am not exactly sure how to go about this yet, I have some ideas but i'm not sure if they are within the limitations set by Java3D. Does anybody have any theories on how i might achieve this? I also have a hunch that to do this would involve using immediate/mixed-mode rendering but i'm not sure how this would fit in with the architecture of my program at the moment. Thanks for any help you can give, David Rush =========================================================================== 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". =========================================================================== 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".
