delete vertex on spheres
hi i look for some help with modifying a sphere when hit by raycast.
i found that maybe deleting some vertex is the solution but i am a bit lost and hope someone is great to this stuff and can guide me in the right direction.
i have now wich should grab the obejct when hit and get vertexes.
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, 100)) {
var newmesh : Mesh = other.gameObject.GetComponent(MeshFilter).mesh; var newvertices : Vector3[] = newmesh.vertices; var newTriangles : int[] = newmesh.triangles; var triList = new Array();
for (i=0; i < newvertices.length; i += 3) {
triList[i]= newTriangles[i]; triList[i+1]=newTriangles[i+1]; triList[i+2]=newTriangles[i+2]; }
newmesh.triangles=triList;
}
Your answer
Follow this Question
Related Questions
raycasts variations 0 Answers
Object Conformity 0 Answers
How to calculate the vertices of an icosphere 1 Answer
Check if two spheres are overlapping one another? 1 Answer
Raycast returns Bad Triangle Index after delete triangles in mesh 1 Answer