Hi, like many other people I’m currently trying to build a sphere from 6 planes. I built a scene with a cube made out of 6 plane primitives that looks like this:
[58549-cube.png*_|58549]
And using the following code:
using UnityEngine;
using System.Collections;
public class Spherize : MonoBehaviour
{
void Start ()
{
Mesh mesh = GetComponent<MeshFilter>().mesh;
Vector3[] vertices = mesh.vertices;
for (int i = 0; i < vertices.Length; i++ )
{
vertices <em>= vertices_.normalized * 5f;_</em>
}
mesh.vertices = vertices;
mesh.RecalculateNormals();
mesh.RecalculateBounds();
* }*
}
The final result, however, isn’t what I expected:
[58551-not-sphere.png|58551]_
Am I missing something? According to most references I found here in Answers my code should work. I’m using Unity 5.2 by the way. Thanks in advance!
_
_*