- Home /
Problem with Cube normalization containing multiple meshes
I am trying to make a planetary Level of Detail System system for my game. The system will consist of a subdivided cube that gets normalized in order to make a sphere. The cube has to consist of multiple meshes in order to make the LOD system work. The problem occurs when I try to normalize multiple meshes into one big sphere I get this weird problem. (Please note in that image I only make 3 of the 4 meshes on the top face on purpose)
I know that I generate the meshes properly, because when I uncheck rounded, I get this. (Again, Please note in that image I only make 3 of the 4 meshes on the top face on purpose)
The code that gets executed for the rounding looks like this
Vector3[] chunkVerticies = mesh.vertices;
for (int vertex = 0; vertex < mesh.vertexCount; vertex++)
{
Vector3 pos = center.InverseTransformPoint(transform.TransformPoint(chunkVerticies [vertex]));
pos = pos.normalized * PlanetInfo.radius;
chunkVerticies [vertex] = transform.InverseTransformPoint(center.TransformPoint(pos));
}
Where Mesh is the mesh to get normalized, center is the center of the planet, and PlanetInfo contains information about the planet.
Thank you in advance, Bart
http://answers.unity3d.com/questions/1077976/normalizing-several-meshes-towards-a-sphere.html was where I got the backbone for my code.
For more clarity, on the two images, only three-quarters of the top were being generated with the LOD system, that is not the problem I need solved
I double checked all the transfor$$anonymous$$g the point into a common space a code and it looks right.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Procedural Tree Placement using perlin noise 1 Answer
[Help]New, procedurally generated materials are black. 1 Answer
Morph along the 4th dimension 1 Answer