Comments and answers for "Creating a sphere out of six planes"
http://answers.unity.com/questions/217033/creating-a-sphere-out-of-six-planes.html
The latest comments and answers for the question "Creating a sphere out of six planes"Comment by Ebil
http://answers.unity.com/comments/401544/view.html
It has nothing to do with box projection. Im talking about generating 6 planes, use a procedural generated hightmap on them and transform the 6 sided terrain to a (perfect) sphere.Mon, 18 Feb 2013 15:24:30 GMTEbilComment by MountDoomTeam
http://answers.unity.com/comments/401242/view.html
making round things from 6 planes?I have done something related, UV mapping any procedural shaped with 6 planes, called box projection, you can map spheres also, although I haven't figured the normals yet.Mon, 18 Feb 2013 01:27:06 GMTMountDoomTeamComment by Xete on Xete's answer
http://answers.unity.com/comments/395778/view.html
(meant to be try kinda hurried cuz it was sleep time) and wohoo atm i managed to get the spherical thing working with both a cube and a plane, it just applies your code to the object many times u want, once u have it working just once then you can just put it in start function, of course u gotta change the amount too, where it goes is Vector3(vertices[i].x/ amount *.... <-- each time u calculating a vertice position, then change ur amount to 0.5 in inspector and it shud work once (for plane into spherical form) and for cube well u have to run it and then refresh it again in the inspector to make it a sphere,, plane =1 refresh, cube = 2 refresh, atm im trying to apply random heights for each plane and sorry if i dnt make senseFri, 08 Feb 2013 11:26:42 GMTXeteComment by Ebil on Ebil's answer
http://answers.unity.com/comments/395701/view.html
But whats the tryu() function? o.oFri, 08 Feb 2013 07:54:10 GMTEbilAnswer by Xete
http://answers.unity.com/answers/395608/view.html
okay i may have found out the problem although i am not sure, simply have:
var amount : float = 1.0f;
var refresh:boolean = false;
function Start () {
tryu();
}
at top then this
function Update () {
if(refresh){
tryu();
refresh=false;
}
}
//you be able to see once u keep pressing refresh it begins to turn into a sphere, although not perfectly atm, and thanks for sharing, p.s first time postin so sorry if its already anwseredFri, 08 Feb 2013 07:38:29 GMTXeteComment by Xete on Xete's answer
http://answers.unity.com/comments/395613/view.html
doesnt seem to work on planes tho, it has the same issue in blender,works fine with cubes..sorryFri, 08 Feb 2013 02:41:36 GMTXeteComment by Xete on Xete's answer
http://answers.unity.com/comments/395612/view.html
okay improvement, now time to sleep ,lucid dream timeeeeeeee, anyways so before starting on the inspector mode, simple change the amount to 0.5f, and with one refresh on a high poly cube will make it nicely perfect sphere, well like 80%perfect, it kinda expands the cube making it more suitable rather than shrinking it to sphere which isnt goodFri, 08 Feb 2013 02:38:18 GMTXeteComment by Ebil on Ebil's answer
http://answers.unity.com/comments/217581/view.html
Bump maps work perfectly on a sphere. But if you want to create a Planet, you need mountains, hills, craters, canyons and so on. I want to do that with a highmap. That cant be used on a sphere, but on 6 pla nes that are then formed to a sphere. Thats the usual way how to do it. Also normal spheres got too much disortion.
I wonder why this is working for you ... Its not working for me o.o.
I try that for days now and want to know what i do wrong, if my code is correct -____-Wed, 15 Feb 2012 18:50:55 GMTEbilComment by Owen-Reynolds on Owen-Reynolds's answer
http://answers.unity.com/comments/217559/view.html
Your code above works perfectly -- I tried it on a high-poly cube, with (0,0,0) in the center. It deforms it into a perfect sphere, keeping the same lighting as when it was a cube.
I can't think of a use for it. Normal mapping works fine on regular spheres.Wed, 15 Feb 2012 17:31:06 GMTOwen-ReynoldsComment by Ebil
http://answers.unity.com/comments/217449/view.html
Well what I have to do with the normals? I just changed vertices, I tried to change normals but nothing happens (I never worked with them).
Whats the difference between normals and vertices?
The position of the object is minor.
Please see my comment below for actual state.
Still dont know how to go on :/Wed, 15 Feb 2012 10:48:36 GMTEbilComment by Ebil on Ebil's answer
http://answers.unity.com/comments/217447/view.html
I tried it with just one plane, with 6 seperated and with a high poly cube.
All is the same result, it has nothing to do with orientation or position :/
I make no progress, yesterday tried the whole day how to create the sphere. But its always nearly the same result as you see above.
I used this code now :
for (var i = 0; i < vertices.Length; i++)
{
vertices[i] = Vector3(vertices[i].x*($$anonymous$$athf.Sqrt(
1-($$anonymous$$athf.Pow(vertices[i].y,2) / 2)
- ($$anonymous$$athf.Pow(vertices[i].z,2) / 2)
+ (($$anonymous$$athf.Pow(vertices[i].y,2) * $$anonymous$$athf.Pow(vertices[i].z,2)) / 3))),
vertices[i].y*($$anonymous$$athf.Sqrt(
1-($$anonymous$$athf.Pow(vertices[i].z,2) / 2)
- ($$anonymous$$athf.Pow(vertices[i].x,2) / 2)
+ (($$anonymous$$athf.Pow(vertices[i].z,2) * $$anonymous$$athf.Pow(vertices[i].x,2)) / 3))),
vertices[i].z*($$anonymous$$athf.Sqrt(
1-($$anonymous$$athf.Pow(vertices[i].x,2) / 2)
- ($$anonymous$$athf.Pow(vertices[i].y,2) / 2)
+ (($$anonymous$$athf.Pow(vertices[i].x,2) * $$anonymous$$athf.Pow(vertices[i].y,2)) / 3))));
}
And the result is that:
http://imageshack.us/photo/my-images/263/crapcube.png/
out of that plane:
http://imageshack.us/photo/my-images/836/planei.png/Wed, 15 Feb 2012 10:46:17 GMTEbilComment by Owen-Reynolds
http://answers.unity.com/comments/217272/view.html
Turning a cube into a sphere, leaving normals alone, will give the new sphere a "flat-sided" shading -- the exact opposite of what most people want. But, if you really wanted that, you could start with a sphere and assign normals (1,0,0), (0,1,0) ... to each vert based on the largest axis.
You might also check your original model has (0,0,0) in the exact center (the formula seems to assume that.)Tue, 14 Feb 2012 19:31:47 GMTOwen-ReynoldsComment by Owen-Reynolds on Owen-Reynolds's answer
http://answers.unity.com/comments/217270/view.html
If you tried it on just one plane, you'd get just one of those shallow bowl shaped meshes. It would be easier to see any problems. Once that worked, you could copy it, rotated to make the other 5 "faces."Tue, 14 Feb 2012 19:24:18 GMTOwen-ReynoldsComment by Ebil
http://answers.unity.com/comments/217157/view.html
I also had this x* ... it doesnt worked and looked even more crappy, so i removed it.
Easier ways? What do you have in mind? afaik thats the easiest way.Tue, 14 Feb 2012 10:31:44 GMTEbilComment by Ebil on Ebil's answer
http://answers.unity.com/comments/217155/view.html
Yes I tried also = , its nearly the same result.
What do you mean by one plane?
Its common to use six planes to create a sphere out of it, never heard of just one plane.
The cube you see there is made of 6 planes, so there is every direction included, but you see the result :/Tue, 14 Feb 2012 10:30:06 GMTEbilComment by Owen-Reynolds
http://answers.unity.com/comments/217074/view.html
Looks like you forgot the `x*` at the start (and the `y*` and 'z*') -- right in front of all the square roots.
Plus, there are probably easier ways to do whatever normal map thing it is.Tue, 14 Feb 2012 01:56:52 GMTOwen-ReynoldsAnswer by DaveA
http://answers.unity.com/answers/217039/view.html
Some thoughts: You should only need to deform one plane (Unity's default plane has 10 x 10 cells, if you need more, use Blender to make one, or generate it from scratch). Make sure you are deforming in the correct direction for that plane.
Also you probably want to use = instead of += to assign the new valuesTue, 14 Feb 2012 00:11:16 GMTDaveA