Help Me Understand Rotation from an Arbitrary basis

In summary: Y and X coordinates based on a World Coordinate system, but the object's origin point is not fixed and can change. This is causing issues with rotations not matching up correctly, and the solution may involve translating the object back to the world origin and then back to its original position after performing the desired rotation. The specific implementation will depend on the software interface and the data used to describe the object's state.
  • #1
Legato Bluesummers
7
0
Apologies on the vague title, I'm having some trouble describing what I'm trying to do and need some context.

I have a 3D World Coordinate system that is static, using an extrinsic left-handed ZYX system.

I have an object with a radius of 1 unit (generic), this is arbitrarily placed within the environment, so at any position, within the world's boundaries, but always an initial rotation of (A,0,0). A = an arbitrary (unknown) rotation on the Z axis.

The goal here is to apply rotation to the object's Y and X coordinates. I am only able to apply rotation based on the World Coordinate system. So if I give it a Rotation of 30units on the Y axis, then 30 units on the X axis, it rotates them based on the World Coordinate system.

Here's where I become confused, most of what I'm reading assumes the Origin point is somewhere else, or at 0,0,0. In my case, it is quite random. but is always the position of where the object lands / placed. The rotational information comes from the object's basis. which then applied to the object from world basis causes issues.

Clawing in the dark, i think it may be as simple as multiplying the world vector Matrix by the object's vector Matrix. So I'm really asking, what do I need to know to get to an answer here? The specifics aren't a concern, a general concept would be more helpful.

Hopefully not in wrong forum, idk where to ask this.
 
Mathematics news on Phys.org
  • #2
Legato Bluesummers said:
The goal here is to apply rotation to the object's Y and X coordinates.

What does that mean? Do you mean you want to rotate the object about an axis that is perpendicular to the XY-plane?
 
  • #3
Stephen Tashi said:
What does that mean? Do you mean you want to rotate the object about an axis that is perpendicular to the XY-plane?

I'm uploading a 4 min youtube video right now explaining exactly what I'm doing using a 3d environment, so it should be very obvious what the issue is, I just cannot seem to communicate this accurately. I don't know the terms or have the technical ability to do so. It should be uploaded in about 20 minutes.
 
  • #4
Stephen Tashi said:
What does that mean? Do you mean you want to rotate the object about an axis that is perpendicular to the XY-plane?
 
  • #5
The general description of the mathematical algorithm you can use has 3 steps:

1. Translate the object back to the world origin
2. Perform the desired rotation about the z-axis while the object is at the world origin
3. Translate the object back to its original position

How to implement this in a particular software program interface obviously depends on the interface.

How the mathematical steps are written as equations depends on what data you use to describe the state of an object. The description of state probably includes the position of the "center" of the object. What else does it include? - the location of the vertices of a triangle?
 
  • #6
Wings 3d has a feature called rotate to target, you select a vertex, surface or line and chose the direction of rotation, based about that point and only that point. I have a hard time understanding the problem in detail though, but

1. you want the object to only rotate about the Z axis?
2. You want this rotation to be carried out on a certain point on the object?
3. You want to implement this in the in game world, which means you would need to know how to program this?

Usually when you do the standard rotate in wings 3d the software does it at the geometric centre of your object. If you want it to rotate at another point you have to chose.

yuHLAyj.png
 
Last edited:
  • #7
Stephen Tashi said:
The general description of the mathematical algorithm you can use has 3 steps:

1. Translate the object back to the world origin
2. Perform the desired rotation about the z-axis while the object is at the world origin
3. Translate the object back to its original position

How to implement this in a particular software program interface obviously depends on the interface.

How the mathematical steps are written as equations depends on what data you use to describe the state of an object. The description of state probably includes the position of the "center" of the object. What else does it include? - the location of the vertices of a triangle?

maybe I didn't make it clear in the video, but what is happening is that the Player drops an object at his exact location, the rotation of the Player only changes on the Z axis. therefore, the object that is dropped has the same Z rotation as the player. and because I'm getting the Z positions from my triangles at that rotation around the Z axis, it influences the X and Y rotations from coming out right.

I'm ONLY wanting X and Y rotations based off of the triangles that I solve. The Player may not rotate along the X and Y, but the Object needs to rotate on the X and Y to match the Terrain.

to answer you question, the object that is dropped has an origin, that origin is what rotates the 3d model. There is no need to determine the vertex manipulation of the object, that is already taken care of by the game engine. the video shows exactly how its handled. in game.
Bipolar Demon said:
Wings 3d has a feature called rotate to target, you select a vertex, surface or line and chose the direction of rotation, based about that point and only that point.

This is for a game engine, which I'm controlling through a script. I just used 3ds max to demonstrate what I'm doing, and what I need.
 
  • #8
Bipolar Demon said:
Wings 3d has a feature called rotate to target, you select a vertex, surface or line and chose the direction of rotation, based about that point and only that point. I have a hard time understanding the problem in detail though, but

1. you want the object to only rotate about the Z axis?
2. You want this rotation to be carried out on a certain point on the object?
3. You want to implement this in the in game world, which means you would need to know how to program this?

Usually when you do the standard rotate in wings 3d the software does it at the geometric centre of your object. If you want it to rotate at another point you have to chose.

I want the X and Y rotations, the Z rotation is known. Once i drop my three (stars in the video, ie Point A, Point B, Point C) objects onto the ground, those give me Z positions of the terrain, from those I create and solve triangles to determine the slope of the rotation on the X and Y axises BASED upon the arbitrary Z rotation of the object.

the rotation happens at the origin of the object.

I can code just about anything, i already have 2d and 3d rotation matrices setup to be used, b/c I assumed that's what I needed to use, however I don't really understand how to use them.
 
  • #9
can you give an analogy/example to some other game or real life example where this has been implemented ? : - )
 
  • #10
Bipolar Demon said:
can you give an analogy/example to some other game or real life example where this has been implemented ? : - )

Let me just explain exactly what I'm doing. In the game, you can place any object you want at any position along any XYZ axis. so anywhere in 3 dimensions. The problem is that terrain exists that has all kinds of different angles. the engine does not drop an object and give you the correct rotation to match that terrain. So the solution is to fire projectiles at the ground using very small collision objects, these stick to the ground/terrain and give my Z positional data. so i have three shooters, each firing a projectile, in some cases, projectile A = 5, projectile B = -1, projectile C = 2. these represent the different heights of the terrain around the player and future object.

Next is just using pythagorean theorem and the Law of cosines to create right triangles and solve them for the correct angle/slope in which to apply to my object.

The problem is that the shooters always follow the player's line of sight, which becomes the Z angle. if the Player is looking at 45 degrees, all three shooters AND the object spawn at 45 degrees on the Z axis, all in tandem with the player's line/angle of sight.

when i solve the triangles, I'm solving them at 45 degrees, or w/e Z rotation my player is currently looking. now then I attempt to apply those X and Y rotations to my object, but the rotations are applied to the object not based on the 45 degrees but from the world coordinate system. so a Y rotation (pitch) is applied as it would be from the world basis.
 
Last edited:
  • #11
Stephen Tashi said:
The general description of the mathematical algorithm you can use has 3 steps:

1. Translate the object back to the world origin
2. Perform the desired rotation about the z-axis while the object is at the world origin
3. Translate the object back to its original position

Im wondering if the solution is just to put the object's Z rotation to 0 and then apply the Y and X rotations and then rotate it back to the former z rotation?

my brain is a little fried from thinking about this for so long. i hope i didn't overthink this and make it extremely complicated...

edit: now i remember why i couldn't do this, but maybe there is a simple solution, i can't use rotation offsets, i can only directly change the rotation, since the game uses an extrinsic ZYX rotation scheme, i have to rotate the Z first, then Y, then X, so i can't turn the thing to Z = 0, apply the rotations on the Y and X. I have to do it all at once, in the correct order.

edit2: yes, if Z rotation of the object is 45 degrees, i can subtract 45, making it zero, then apply the Y and X rotations, but then I need to do another set of ZYX rotations to put it back to 45 degrees on the Z, which would change the Y and X rotations. There has to be a way to use the 3d rotation matrix or some other math formula to achieve this.
 
  • #12
Legato Bluesummers said:
it influences the X and Y rotations from coming out right.
You need to clarify what you mean by "an X rotation". A rotation has an axis. It has an angle of rotation. A point has an x coordinate and if that point is rotated about some axis by some angle, it moves to a point with a different x coordinate. So what is "an x rotation"? Is it a rotation about the x-axis? Is the change in the x-coordinate of a point that is being rotated about some axis?
 

FAQ: Help Me Understand Rotation from an Arbitrary basis

How does rotation from an arbitrary basis work?

Rotation from an arbitrary basis is a mathematical concept that describes the rotation of an object or coordinate system around an arbitrary point or axis. It involves using a set of transformation matrices to rotate the coordinates of the object or system in a specific direction and magnitude.

Why is understanding rotation from an arbitrary basis important in science?

Rotation from an arbitrary basis is important in science because it allows us to accurately describe the movement and orientation of objects in space. This is crucial in fields such as physics, astronomy, and engineering, where precise measurements and calculations are necessary.

What is the difference between rotation from an arbitrary basis and rotation from a fixed basis?

The main difference between rotation from an arbitrary basis and rotation from a fixed basis is the reference point or axis used for the rotation. In a fixed basis, the rotation is always around a specific point or axis, while in an arbitrary basis, the rotation can be around any point or axis.

How is rotation from an arbitrary basis used in computer graphics?

In computer graphics, rotation from an arbitrary basis is used to manipulate and transform the positions of 3D objects in a virtual space. This allows for realistic and dynamic animations and simulations.

Can rotation from an arbitrary basis be applied to any object or system?

Yes, rotation from an arbitrary basis can be applied to any object or system, as long as it can be represented as a set of coordinates or points in space. This includes both 2D and 3D objects, as well as abstract systems such as coordinate systems or vectors.

Similar threads

Replies
2
Views
3K
Replies
10
Views
554
Replies
11
Views
8K
Replies
1
Views
796
Replies
6
Views
3K
Back
Top