Creating a colored cube with each face colored differently?

Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating a colored cube with each face colored differently?

sachuraju
Hi,

In developing the Rubik's cube, I'm now in the final stage where I need to create a cube with all 6 faces of different colors.

When I look at how one assigns a color to a cube, we create a Material object, and pass it to the TCube. The TCube passes it to its super classes, and finally we hit TMesh, where the material object is put into the MaterialList (at 1).

Then at render time, I see that the method renderPrimitve: ogl alpha: alphaPass is called to render the object, in which the materialList is made use of. Not being a graphics guy myself, I'm unable to figure out what is happening in this function, and so it would be great if someone can put into words what is happening in that method.

This will help me change the method so that I can perhaps use it to render a cube with all faces colored differently.

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Creating a colored cube with each face colored differently?

David A. Smith
The TCube may use the same material for all 6 sides if I recall. You may need to create your own object, probably by using 6 TRectangles properly oriented. Each rectangle can have its own material that way. Another possibility is create the cube you want in a 3D editor, export to collada and load it into your scene. Then just make 26 copies (don't need one in the center).

DAS


On Mon, Apr 29, 2013 at 8:44 PM, sachuraju <[hidden email]> wrote:
Hi,

In developing the Rubik's cube, I'm now in the final stage where I need to
create a cube with all 6 faces of different colors.

When I look at how one assigns a color to a cube, we create a Material
object, and pass it to the TCube. The TCube passes it to its super classes,
and finally we hit TMesh, where the material object is put into the
MaterialList (at 1).

Then at render time, I see that the method renderPrimitve: ogl alpha:
alphaPass is called to render the object, in which the materialList is made
use of. Not being a graphics guy myself, I'm unable to figure out what is
happening in this function, and so it would be great if someone can put into
words what is happening in that method.

This will help me change the method so that I can perhaps use it to render a
cube with all faces colored differently.

Thanks.



--
View this message in context: http://forum.world.st/Creating-a-colored-cube-with-each-face-colored-differently-tp4684501.html
Sent from the Croquet - Dev mailing list archive at Nabble.com.



--
David A. Smith
Picture
Reply | Threaded
Open this post in threaded view
|

Re: Creating a colored cube with each face colored differently?

sachuraju
And by the looks of it, I think that doing the latter seems simpler? 


On Mon, Apr 29, 2013 at 7:57 PM, David A. Smith [via Smalltalk] <[hidden email]> wrote:
The TCube may use the same material for all 6 sides if I recall. You may need to create your own object, probably by using 6 TRectangles properly oriented. Each rectangle can have its own material that way. Another possibility is create the cube you want in a 3D editor, export to collada and load it into your scene. Then just make 26 copies (don't need one in the center).

DAS


On Mon, Apr 29, 2013 at 8:44 PM, sachuraju <[hidden email]> wrote:
Hi,

In developing the Rubik's cube, I'm now in the final stage where I need to
create a cube with all 6 faces of different colors.

When I look at how one assigns a color to a cube, we create a Material
object, and pass it to the TCube. The TCube passes it to its super classes,
and finally we hit TMesh, where the material object is put into the
MaterialList (at 1).

Then at render time, I see that the method renderPrimitve: ogl alpha:
alphaPass is called to render the object, in which the materialList is made
use of. Not being a graphics guy myself, I'm unable to figure out what is
happening in this function, and so it would be great if someone can put into
words what is happening in that method.

This will help me change the method so that I can perhaps use it to render a
cube with all faces colored differently.

Thanks.



--
View this message in context: http://forum.world.st/Creating-a-colored-cube-with-each-face-colored-differently-tp4684501.html
Sent from the Croquet - Dev mailing list archive at Nabble.com.



--
David A. Smith
Picture



If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/Creating-a-colored-cube-with-each-face-colored-differently-tp4684501p4684503.html
To unsubscribe from Creating a colored cube with each face colored differently?, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Creating a colored cube with each face colored differently?

Dmitriy Kazimirow
In reply to this post by sachuraju
unsubscribe


2013/4/30 sachuraju <[hidden email]>
Hi,

In developing the Rubik's cube, I'm now in the final stage where I need to
create a cube with all 6 faces of different colors.

When I look at how one assigns a color to a cube, we create a Material
object, and pass it to the TCube. The TCube passes it to its super classes,
and finally we hit TMesh, where the material object is put into the
MaterialList (at 1).

Then at render time, I see that the method renderPrimitve: ogl alpha:
alphaPass is called to render the object, in which the materialList is made
use of. Not being a graphics guy myself, I'm unable to figure out what is
happening in this function, and so it would be great if someone can put into
words what is happening in that method.

This will help me change the method so that I can perhaps use it to render a
cube with all faces colored differently.

Thanks.



--
View this message in context: http://forum.world.st/Creating-a-colored-cube-with-each-face-colored-differently-tp4684501.html
Sent from the Croquet - Dev mailing list archive at Nabble.com.



--
--
Best Regards,
Dmitriy Kazimirov,


READ CAREFULLY.
By accepting or reading this e-mail you agree to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browserwrap, confidentiality, non-disclosure, non-compete and acceptable use policies («BOGUS AGREEMENTS») that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.

This shall include (but not be limited to) treatment of any e-mail communications I receive, which become my sole and inalienable property, so that disposition thereof is governed exclusively by legislation of the Russian Federation and by my own code of ethics, irrespective of anything which may have made you believe otherwise, including my perceived acceptance of a BOGUS AGREEMENT you may have enclosed in your correspondence
Reply | Threaded
Open this post in threaded view
|

Re: Creating a colored cube with each face colored differently?

David A. Smith
Yes. If you have the ability model it, it should be quite a bit easier.
David


On Mon, Apr 29, 2013 at 10:48 PM, Dmitriy Kazimirov <[hidden email]> wrote:
unsubscribe


2013/4/30 sachuraju <[hidden email]>
Hi,

In developing the Rubik's cube, I'm now in the final stage where I need to
create a cube with all 6 faces of different colors.

When I look at how one assigns a color to a cube, we create a Material
object, and pass it to the TCube. The TCube passes it to its super classes,
and finally we hit TMesh, where the material object is put into the
MaterialList (at 1).

Then at render time, I see that the method renderPrimitve: ogl alpha:
alphaPass is called to render the object, in which the materialList is made
use of. Not being a graphics guy myself, I'm unable to figure out what is
happening in this function, and so it would be great if someone can put into
words what is happening in that method.

This will help me change the method so that I can perhaps use it to render a
cube with all faces colored differently.

Thanks.



--
View this message in context: http://forum.world.st/Creating-a-colored-cube-with-each-face-colored-differently-tp4684501.html
Sent from the Croquet - Dev mailing list archive at Nabble.com.



--
--
Best Regards,
Dmitriy Kazimirov,


READ CAREFULLY.
By accepting or reading this e-mail you agree to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browserwrap, confidentiality, non-disclosure, non-compete and acceptable use policies («BOGUS AGREEMENTS») that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.

This shall include (but not be limited to) treatment of any e-mail communications I receive, which become my sole and inalienable property, so that disposition thereof is governed exclusively by legislation of the Russian Federation and by my own code of ethics, irrespective of anything which may have made you believe otherwise, including my perceived acceptance of a BOGUS AGREEMENT you may have enclosed in your correspondence



--
David A. Smith
Picture