- Home /
Translate a set of points
This is most likely a basic question but i cannot seem to find the correct answer. I have a set of points that i want to alter based on the following: A 3d vector is defined, say (300,0,500). This vector is supposed to be my new X axis. What formula must be applied to each point to make this change, and how do i do that in Unity?
Cheers
EDIT: Let me give some more insight: I have a set of points that comprise a larger one, a "point cloud" if you would like. This cloud rotates, moves in the scene e.t.c. However, at certain time intervals I have the aforementioned vector, which starts from the cloud's left most point and ends at the right most point ( in the case where the object rotated, it's the inverse). I want to have a separate area in my scene where I translate all of the points comprising the object to a view that does not change with rotation or translation of the original object, so as to view the object's front if you like (again, this will happen only at the time intervals the vector is available). Hopefully it's more clear now.
Answer by rensjan2122 · Dec 17, 2014 at 11:19 PM
i think it is something like this
GameObject[] array = new GameObject[#objects];
for(int i=0;if<array.Length;if++){
Array[i] = GameObject("object");
}
Vector3 Test = new Vector3(300,0,500);
for(int i=0;if<array.Length;if++){
Array[i].transform.position = Test.x;
}
Your answer
Follow this Question
Related Questions
How to Reset Quaternion/Rotation On 3D Object After Dragging Mouse? 2 Answers
need help regarding rotating arm 0 Answers
How to synchronize both movement and rotation? 1 Answer
How to smoothly rotate an object on only two axes? 2 Answers
Clamped Rotate 3D Object on Y and Z axis only with OnMouseDrag() 2 Answers