- Home /
Maping cube to sphere. Help.
I am a complete noob at scripting and have been look at taking a cube and turning it into a sphere for my planet generation. I first need to map my cube to a sphere but I have not been able to do it. All I want to do is take the cube's point normalize it and then times it by the radius "something" = "something".normalized * radius
I just don't know how to do this in code. I have been using c# but I don't really care what I get a answer in. Any help would be appreciated.
I'm not sure what you are attempting here. Cubes and spheres are meshes. Are you saying you to duplicate and rotate cubes to create a sphere-like construct composed of a multitude of cubes? Or are you trying to build a mesh. If you are trying to build meshes, the wiki has some source for a variety of shapes that you can exa$$anonymous$$e.
$$anonymous$$aybe this will help you understand what I mean http://www.nullpointer.co.uk/content/procedural-planets/
I'd classify this as an "advanced" project, so as a "complete noob" you may struggle for some time in order to make it happen. Here are a few links to get you started:
Procedural cube - just 1 x 1 and you will need to fix the triangle order problem. But it is simple example of building a cube mesh.
Create plane - plane code that allow you to set the number of segments. You can look at how they did it, and use their mesh for figuring out how to modify vertices.
Procedural examples - select the procedural examples from this page.
Wow sometimes I cannot believe coincidence : I am literally reading up on this right now !
Current open links :
One I'm about to go with : http://petrocket.blogspot.com.au/2010/04/sphere-to-cube-mapping.html
http://mathproofs.blogspot.com.au/2005/07/mapping-cube-to-sphere.html
http://forum.unity3d.com/threads/69759-$$anonymous$$apping-a-cube-to-a-sphere
I keep saying it because as you see I do it : A Search Engine Is Your Friend =]
Answer by Bunny83 · Mar 04, 2013 at 09:22 AM
Yet another question like that.
http://answers.unity3d.com/questions/319082/stitch-spheriphied-terrain-like-6-planes-removing.html http://answers.unity3d.com/questions/357993/mapping-a-cube-to-a-sphere.html
Your answer
Follow this Question
Related Questions
Why is my y-axis bugging? 1 Answer
How to make flat object(Unity 2D) 1 Answer
Mapping a cube to a sphere 1 Answer