POV-Ray : Newsgroups : povray.binaries.images : Rubix Cube Server Time
4 Oct 2024 07:13:02 EDT (-0400)
  Rubix Cube (Message 1 to 10 of 17)  
Goto Latest 10 Messages Next 7 Messages >>>
From: RED-Cow
Subject: Rubix Cube
Date: 5 May 1999 19:14:35
Message: <3730C25A.76C1@erols.com>
I got bored the other day and decided to make one of these.  I'm
wondering if Moray's Inverse Kinematics could be used to make it so the
sides are rotatable.  That would be cool.


Post a reply to this message


Attachments:
Download 'rubix.gif' (6 KB)

Preview of image 'rubix.gif'
rubix.gif


 

From: Ken
Subject: Re: Rubix Cube
Date: 5 May 1999 20:53:01
Message: <3730D956.A443BD4C@pacbell.net>
RED-Cow wrote:
> 
> I got bored the other day and decided to make one of these.  I'm
> wondering if Moray's Inverse Kinematics could be used to make it so the
> sides are rotatable.  That would be cool.

  From what I understand about inverse kinematics this would probably
be a poor application of it's abilities. All you really need to do is
declare a group of nine cubes on one face in a union and then rotate
it around it's own axis.

 A little random color distribution from that shown would at least
seperate yours from the dozen or so I have seen all displayed in a
solved state of rest.

  To get it really mixed up i.e. to make it usable is not something I
think would be worth the effort. Might make for a really challenging
animation project. Write a routine that randomly mixes up the cube and
the remainder of the animation pov spends trying to solve it. Might be
possible but way beyond anything I would like to try.

  Hey Spider ! Got a new challenge for you. <* big wide grin *>

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Spider
Subject: Re: Rubix Cube
Date: 5 May 1999 22:04:34
Message: <3730E94D.63153DE9@bahnhof.se>
Ken wrote:
> 
> RED-Cow wrote:
> >
> > I got bored the other day and decided to make one of these.  I'm
> > wondering if Moray's Inverse Kinematics could be used to make it so the
> > sides are rotatable.  That would be cool.
> 
>   From what I understand about inverse kinematics this would probably
> be a poor application of it's abilities. All you really need to do is
> declare a group of nine cubes on one face in a union and then rotate
> it around it's own axis.
> 
>  A little random color distribution from that shown would at least
> seperate yours from the dozen or so I have seen all displayed in a
> solved state of rest.
> 
>   To get it really mixed up i.e. to make it usable is not something I
> think would be worth the effort. Might make for a really challenging
> animation project. Write a routine that randomly mixes up the cube and
> the remainder of the animation pov spends trying to solve it. Might be
> possible but way beyond anything I would like to try.
> 
>   Hey Spider ! Got a new challenge for you. <* big wide grin *>

oh, great, thanks :-)
*grins*

Well, to solve this one, I think It'd be easiest to start from a "correct" cube.
Then, using a macro to rotate the sides...

You'dd use a 3x3x3 array to specify each "row" (a square, really.) of boxes.

from one side it would be: (ascii)
+-----------+
|  0        |
+-----------+
|  1        |
+-----------+
|  2        |
+-----------+
Then, to rotate theese, youd simply(hehe, not really) write a macro that takes
in the row, and rotates this arounnd an axis. 

Either three different macros (my preferred idea) or one that takes two
values(axis and number, this is more difficult since you must decide in what
plane the square is to be found)

#declare colour_index = array[6] { //Each colour. used inside the cube array.
  colour rgb <1,1,1>,  //White, first colour
  colour rgb <1,1,0>,  //Yellow
  colour rgb <0,0,1>,  //Blue
  colour rgb <0,1,0>,  //Green
  colour rgb <1,0,0>,  //Red
  colour rbg <0,1,1>  //What's the last one? I don't have a cube.
}


//This array contains every individual "block-face" in the cube.
#declare cube = array[3][3][6] { //Number theese so that all sides have the 
				//right colours.
				//The axis are the face normals. (commented)
  {{0,0,0},{0,0,0}}, //+y
  {{1,1,1},{1,1,1}}, //-y
  {{2,2,2},{2,2,2}}, //+z
  {{3,3,3},{3,3,3}}, //-z
  {{4,4,4},{4,4,4}}, //+x
  {{5,5,5},{5,5,5}}} //-x
}

#macro rotate_y(iRow) { //rotate around the y axis. numbered from +y to -y
  #local theBox = array[3][4] { //A snip the right row. 
				//3 boxes a side, 4 sides.
//Well, I'm tired, can't figure out how to decide what row is where. 
//I'll think about it tomorrow.
//I'd guess for this:
    {cube[][][],cube[][][],cube[][][]},
    {cube[][][],cube[][][],cube[][][]},
    {cube[][][],cube[][][],cube[][][]},
    {cube[][][],cube[][][],cube[][][]}
  }
}


After some thinking, I realise this code won't really work at all.
The outer lines aren't counted for. I'll blame my tiredness..
But, yes, i think I can solve it using a few arrays and a couple of macros.
Thanx for the thought anyway, ken :-)

Then there is the small matter of interpolating the frames so it becomes a
smooth animation. the way I had in mind would have to be modified to use a clock
operator with the rotates. It won't be that easy to do it then...

perhaps if it was solved as a 3x3x3 array, where you manually numbered and
placed each cube in the original position, with correct colours on the sides.
That way a smooth rotation could be implemented fairly easy.

But, as I think you can guess, i'm pretty tired, adn I haven't started to work
with animations yet. might take a while before I start.


Well, I might solve this one yet. I'll be in touch, I hope.



-- 
//Spider    --  [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
And the meek'll inherit what they damn well please
	Get ahead, go figure, go ahead and pull the trigger
		Everything under the gun
			--"Sisters Of Mercy" -- "Under The Gun"


Post a reply to this message

From: Nobot
Subject: oh my
Date: 6 May 1999 00:50:40
Message: <3731113D.BE78599F@powersurfr.com>
Ken, your idea to make pov solve it seems like an interesting mathematical
problem and an it couldn't help.... hmmm maybe you could get some use of a
super computer and say it's academic research :) it would be a cool animation
especially if it looked right like all the proper specular and sizes and
everything maybe over some sort of a plain that changes color like a disco
floor.... hammy this  very interesting, thanks for the idea


Post a reply to this message

From: GrimDude
Subject: Re: Rubix Cube
Date: 6 May 1999 02:31:56
Message: <3731294c.0@news.povray.org>
The real time solution of one of these things would lead to a very large
animation, indeed. I would say a minimum of 500 frames, and probably more.

GrimDude
vos### [at] arkansasnet


Post a reply to this message

From: Ph Gibone
Subject: Re: Rubix Cube
Date: 6 May 1999 02:43:53
Message: <37312c19.0@news.povray.org>
>
>  From what I understand about inverse kinematics this would probably
>be a poor application of it's abilities. All you really need to do is
>declare a group of nine cubes on one face in a union and then rotate
>it around it's own axis.
>

Not so easy : a cube would have to belong to different groups, I believe
it's not possible !
Philippe


Post a reply to this message

From: GrimDude
Subject: Re: Rubix Cube
Date: 6 May 1999 03:02:45
Message: <37313085.0@news.povray.org>
Hmm, I believe it's possible, though difficult.

GrimDude
vos### [at] arkansasnet


Post a reply to this message

From: Thomas Lake
Subject: Re: Rubix Cube
Date: 6 May 1999 06:28:35
Message: <373160CA.912D315B@home.com>
I think there is an easier way to do this than with complex mathematics. I'm
not sure this would work, though I don't see why not. What you could do is
get a real rubix cube and draw or write down the positions and color of all
the different cubes. Then take a few days off work :-) and solve it as many
times as you can each time writing down all the different moves. Then all you
have to do is recreate the rubix cube in Pov-Ray using the drawing or
description you made of the original cube then animate it using the
instructions you wrote down while solving it.

Ken wrote:

> RED-Cow wrote:
> >
> > I got bored the other day and decided to make one of these.  I'm
> > wondering if Moray's Inverse Kinematics could be used to make it so the
> > sides are rotatable.  That would be cool.
>
>   From what I understand about inverse kinematics this would probably
> be a poor application of it's abilities. All you really need to do is
> declare a group of nine cubes on one face in a union and then rotate
> it around it's own axis.
>
>  A little random color distribution from that shown would at least
> seperate yours from the dozen or so I have seen all displayed in a
> solved state of rest.
>
>   To get it really mixed up i.e. to make it usable is not something I
> think would be worth the effort. Might make for a really challenging
> animation project. Write a routine that randomly mixes up the cube and
> the remainder of the animation pov spends trying to solve it. Might be
> possible but way beyond anything I would like to try.
>
>   Hey Spider ! Got a new challenge for you. <* big wide grin *>
>
> --
> Ken Tyler
>
> mailto://tylereng@pacbell.net


Post a reply to this message

From: Ph Gibone
Subject: Re: Rubix Cube
Date: 6 May 1999 06:57:24
Message: <37316784.0@news.povray.org>
Anxious to see how
Philippe

>Hmm, I believe it's possible, though difficult.
>
>GrimDude
>vos### [at] arkansasnet
>
>


Post a reply to this message

From: Axel Hecht
Subject: Re: Rubix Cube
Date: 6 May 1999 12:08:50
Message: <3731B0CF.2420E39@numerik.uni-kiel.de>
Ken wrote:
> 
> RED-Cow wrote:
> >
> > I got bored the other day and decided to make one of these.  I'm
> > wondering if Moray's Inverse Kinematics could be used to make it so the
> > sides are rotatable.  That would be cool.
> 
>   From what I understand about inverse kinematics this would probably
> be a poor application of it's abilities. All you really need to do is
> declare a group of nine cubes on one face in a union and then rotate
> it around it's own axis.
> 
>  A little random color distribution from that shown would at least
> seperate yours from the dozen or so I have seen all displayed in a
> solved state of rest.
> 
>   To get it really mixed up i.e. to make it usable is not something I
> think would be worth the effort. Might make for a really challenging
> animation project. Write a routine that randomly mixes up the cube and
> the remainder of the animation pov spends trying to solve it. Might be
> possible but way beyond anything I would like to try.
> 

Well posed hell :-)
Two remarks, firstly, not every random order of boxes is solveble! I know a very bad
move towards
others trying to solve your cube, just by twisting one box. No way to ever make it. So
you have to
be really careful to choose or construct a possible order. But then of course one can
implement the
solver, that was there at the time. I used to have it in print, but surfing may yield
to a faster
solution.

Axel

PS: I think the spaces between the colored patches are just a bit to wide.


Post a reply to this message

Goto Latest 10 Messages Next 7 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.