I want to rotate in an arc shap with a given set of from x,y,z values to x,y,z values,
Example if x1=-40, y=2, z3 to xn=45, y=3, z3
it’s almost 85 degree.
How to do that?
I want to rotate in an arc shap with a given set of from x,y,z values to x,y,z values,
Example if x1=-40, y=2, z3 to xn=45, y=3, z3
it’s almost 85 degree.
How to do that?
85 deg between two points on space? How, what does it mean?
Use Quaternion.LookRotation to get two quaternions, one pointing at the first point and another pointed to the second point. Then Quaternion.Slerp to smoothly interpolate from the first quaternion to the second one.
This assumes your points are centered around 0,0,0 and that you only care about rotation.
Quite hard to decode the description. We have in transform 3 sets of vectors: position, rotation, and scale. So like logic goes, with the position we set x, y, z of the game object in space, and with the rotation we set angles in x, y, z space.
You can look into this video, bat initial position is -6 or -8 on the x axis, and bat then reached around -35 on x axis and then it move forward and it reached +40 in x axis, how this can be done programmatically.
Basically we will save all the matrices data from sensor and then load it from database and then model will change accordingly.
Right now can choose some static data to start and later will load it from remote.
How to do that?
Rotation, not Position. You mentioned in a previous post that you were an experienced dev so you’ll know that these words are important.
Move forward? It’s rotating, not moving in position/translation.
Do what? How to rotate? Have you looked at the Transform component?
You can create a simulation loop that iterates through time steps. In each iteration, update the position/rotation of the bat based on the sensor data. The final solution you put inside the Update method of a script attached to the bat.
But if it’s one shoot sensor load you want to use for animation, I think it is better to use the Animator component.
That’s not the position, that’s the rotation.
The gif just shows an object being rotated, nothing more. If that’s what you need, transform.Rotate.