[Papervision3D] stumped recreating multiple axis rotation of rubix cube
nroberton
in8media at gmail.com
Thu Jan 1 13:22:47 PST 2009
Thanks, Vic. I'm not sure I completely understand what you are saying, but
the suggestion of looking at it as a cross makes me realize that I could
solve this in 2D using only bitmap operations with no need for logic or
tracking the position of the cubes. It would be limited in fidelity, but
highly efficient -- and might serve as the "brain" for a higher fidelity
implementation with PV3D.
Thanks!
Nathan
Vic Cekvenich-3 wrote:
>
> I suggest you make a "cross" of cubes first.
> Ex:
> *
> *
> *****
> *
> *
>
> Then, add cubes by row plane, to the center cross cube(s). (do not add
> these cubes to stage, add them to the center cross cube(s))
> When you pivot/yaw center/cross cubes.... the "children" follow.
>
> (once you get that to work rotating rotating one way , you may have to
> remove/readd cubes depending on rotation , but you will see that).
>
> good luck,
>
> .V
> proj.com
> papervision instruction
>
> roberton 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
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
--
View this message in context: http://www.nabble.com/stumped-recreating-multiple-axis-rotation-of-rubix-cube-tp21186606p21244994.html
Sent from the Papervision3D mailing list archive at Nabble.com.
More information about the Papervision3D
mailing list