Inaam,

Very interesting problem... and quite a scenegraph!

I've given it 10 minutes thought, so I'm not convinced there isn't an easier
way, but here are some thoughts:

1. Create all of your cubelets under a dummy BranchGroup. Create 9 TGs each
with an attached behavior to rotate its children through the "correct" +- 90
degrees. As the user switches between slices you have to dynamically
reparent the cubelets for the slice into the correct TG and deactive the
other behaviors.

2. You might be able to use a SharedGroup and a Link Node in each TG? It's
late and my head hurts, so maybe this wouldn't work! This might avoid all
the ugly reparenting that will happen with method 1.

3. Essentially fake the whole thing. If you are only rotating by 90 degree
steps you are not displaying the (interesting) intermediate rotation from
position to position. Track the position of your cubes using an internal
data structure and just *recolor* your static 3D representation to give the
impression that the slices have been rotated.

There must be more, but maybe this will kick start some ideas for you.

Best of luck, let me know how your solve it!

Sincerely,

Daniel Selman

[EMAIL PROTECTED]
http://www.tornadolabs.com

> -----Original Message-----
> From: Discussion list for Java 3D API
> [mailto:[EMAIL PROTECTED]]On Behalf Of Inaam Khan
> Sent: 26 October 1999 00:18
> To: [EMAIL PROTECTED]
> Subject: [JAVA3D] Logical problem using Java3D for Making Rubik Cube
>
>
> Hello i am using Java3d for the first time and am having trouble with
> a method to pick up specific layers of the cube. If any of you understand
> the cube you would know that there are nine layers which we can choose to
> rotate in any direction. I have made the cubelets by using the Box utility
> class. Given them the appropriate color and arranged them in their proper
> places.I have so far made three layers which i can manipulate through the
> key boards but as you know i can only manipulate three layers as they are
> transform group with simple behaviour classes for 90 degrees rotation. I
> can rotate the whole cube by choosing to enable the behavor for the
> branchgroup containing all three transform groups.Now my problem is that
> java3d does not allow cubelets to be put into more than one transform
> group.Or share the cubelets in more than one transform group.If i could do
> so i might update other transform group when ever i rotate a layer but
> this is not possible.
> Just what should i do to be able to pick up any of the nine layers through
> mouse making them rotate only in one axis.Pls i need help and i am very
> desperate if you guys can please send me any
> additional reading material apart from what is given by Java3d i would be
> greatfull.
> I need help fast,some code would do better. I am currently looking in the
> possibility of redoing the cube with geometry classes if their is no way
> around.
> Please i have a deadline approaching in a day any help would be welcome.
> Thanks in advance.
> Inaam Afzal Khan
>
> ==================================================================
> =========
> 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".

Reply via email to