[Papervision3D] stumped recreating multiple axis rotation of rubix cube
nroberton
in8media at gmail.com
Thu Jan 1 13:18:04 PST 2009
Hi, Speedok. It looks like you accomlished exactly what I am trying to do. I
can't tell for sure if yours is really 3D, though. Why is it that it doesn't
rotate during gameplay?
I don't suppose you can share the source?
Nathan
speedok wrote:
>
> Aloha,
>
> I make a rubik some time ago see:
> http://www.flashbookmarks.com/demos/rubik/ demo rubik cube After the
> cube is solved you can 'play' with and rotate it as whole.
>
> The trick was in my case to use a dummy do3d rotate helper object, then
> what needed to be rotated was moved into that, rotate, and put it back in
> the main container.
> Hope that gives you a idea.
>
> Good luck.
>
>
>
> nroberton wrote:
>>
>> I'm fairly stumped trying to recreate the action of rubix cube in
>> Papervision3d. I can get any side of the cube to rotate once, but I'm
>> stuck on getting any subsequent turns figured out.
>>
>> In order to move a side independent from the cube I create a
>> DisplayObject3D, remove the cubelets from the rubixCube DisplayObject3D
>> (not sure why this is necessary, rather than automatic during an attach)
>> and then attach them to the new DisplayObject3D, which I call axisArm.
>>
>> Whether I reattach the cubelets to rubixCube after the animation (moving
>> them back and forth for each turn) or endlessly spawn new axisArm
>> DisplayObject3D's to contain each new turn, the translation/rotation
>> created from the previous turn is always reset.
>>
>> Now that I see what it does, it makes more sense than what I had hoped
>> for (that the transformation would be preserved through each
>> removeChild/attachChild).
>>
>> I realize that I could force it to work by storing an array of
>> MaterialsLists for the cubelets and rewriting it on each turn, and
>> redrawing the materials for each cubelet after each turn when I return
>> them from the axisArm to the rubixCube -- however, this seems like an
>> ugly hack, like the equivalent of peeling the stickers on a real rubix
>> cube. I'd like to find a more elegant solution.
>>
>> Does anyone know any secrets about Papervision3d that would solve this
>> better? Or is there a completely different approach that would get this
>> done in less code?
>>
>> Perhaps if it were set up so that only the center cubelets turn, and the
>> other cubelets were moved entirely by collision while tethered to the
>> center of the rubixCube it might work.
>>
>> Anyway, I've uploaded my file. This uses rev 851 from the site:
>> http://code.google.com/p/papervision3d/downloads/list
>>
>> and TweenLite from greensock:
>> http://blog.greensock.com/tweenliteas3/
>>
>> Any thoughts or suggestions anyone could provide would be greatly
>> appreciated. I am doing this only out of curiosity for the puzzle after
>> my son got a rubix cube for Christmas. I'll probably post it with source
>> on my site at some point.
>>
>> http://www.nabble.com/file/p21186606/Rubix.as Rubix.as
>>
>> Thanks,
>>
>> Nathan Roberton
>> http://nathanroberton.com
>>
>
>
--
View this message in context: http://www.nabble.com/stumped-recreating-multiple-axis-rotation-of-rubix-cube-tp21186606p21244970.html
Sent from the Papervision3D mailing list archive at Nabble.com.
More information about the Papervision3D
mailing list