I have a number of point around a vector that can rotate. When rotating the vector how do I project the points?
Rotating the vector the points do not rotate only translate
I have a number of point around a vector that can rotate. When rotating the vector how do I project the points?
Rotating the vector the points do not rotate only translate
How are you currently getting the points?
A very simple script
for (int i = 0; i < numberOfPoint ; ++i)
{
Vector3 pointVector = new Vector3(0,0,0);
float ang = (360/(float)numberOfPoint)*i;
pointVector.x = vectorStart.x + radius * Mathf.Sin (ang * Mathf.Deg2Rad);
pointVector.z = vectorStart.y + radius * Mathf.Cos (ang * Mathf.Deg2Rad);
pointVector.y = vectorStart.z;
}
I ended with this but probably a better way of doing this
pointVector = math.cross( vectorEndN.xzy ,vectorEndN);
pointVector = Quaternion.AngleAxis(ang, vectorEndN) * pointVector;
Gizmos.color = Color.blue;
Gizmos.DrawSphere(pointVector.normalized, 0.2f);
What are “vectorStart” and “VectorEndN” and “vectorEndN.xzy”?
When you say you’re looking for points around a vector, are you conceptualizing that vector as having a definite location in space, or only a direction and magnitude? (The Unity data type called “vector” only has a direction and magnitude, so to represent something that also has a location you’d actually need two vector variables.)
Based on your pictures, I would assume you are taking into account the vector’s location but ignoring its direction when making your calculation.
I got it working , it was more authoring at origin and projecting to a spherical surface. Thanks again for taking the the time to look at this.