Jump to content

How to create cube inside sphere with different textures or colors


Recommended Posts

Hey fellows,

I want to know how to create a cube inside a sphere. The cube should have a texture from an image. The sphere should be transparent like glass. And finally the cube should spin  respectively the sphere with the cube inside should spin.

I will try to create a PG to prepare the first steps.

Link to comment
Share on other sites

So, here is the PlayGround. It's more than the first step, it's the solution :D.

BUT.. can I put both meshes into one object and clone this object multiple times.

I want to use different textures for the cubes of the cloned objects.

Something like

sphere1.cube.material = material1;

sphere2.cube.material = material2;

sphere3.cube.material = material3;

Link to comment
Share on other sites

My suggestion would be to make the sphere parent to the cube, 

cube.parent = sphere

then clone sphere and try

sphere1.getChildMeshes()[0].material = material1


Wont be on laptop until tomorrow so cannot change you PG to try it myself.

If you combine the sphere and cube into one mesh using mergeMeshes then they have to share a material unless you want to get into multi-materials.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...