Rotation Transformation Values from Camera to Target

i realize using correct terminology is key, im working on improving this.

You pick “camera to target” so let’s say A to B, and draw a line, to then get the perp frame, to extract the Z vector…
Just do: Z=B-A , that is your vector. (or you can do vector = B to A … same thing)


There is not such thing as that… You can make “Point oriented” to create a point into another cartesian system, by using a frame/plane. But you didn’t use that component.

You are making assumptions on how components works, and using them in the wrong way.

Are you making the coordinates+camera orientation of a drone path?!?

What would rx=0 , ry=0 , rz=0 mean to you? the camera facing down? (aligned with XY world axis… ?)

I’m trying to understand…

Im creating a camera system for a video game engine.

In my mind rx,ry,rz = 0 means that it staying at its start rotation value, that is known before i inject these values. Then i would rotate relative to the current values. adding onto them.

I figured as much! but cannot wrap my head around it. Can you tell me which node specifically im misinterpreting? so i can understand.

Ill check out the “point oriented” node after lunch!

Ill post my findings soon.

Thanks for helping, I appreciate it.

Still an issue with point orient. Why isnt perp frame giving me the right values? Im also not pulling the frame from an end point. but offset onto the curve a bit.

Is there some sort of offset occurring on the perp frame that is making the origin in a different location?

I think this is where the issue lies.

Its offset it appears on 2 of 3 axis… +30 degrees on desired z axis and + 60 degrees on desired y axis

You are, again, using points as vectors!

The point you created with “Point oriented” are “born” from a specific cartesian system (your “F” system) but those points will still have absolute world XYZ coordinates!

You need to use vectors!!
See here:2020-04-07 15_36_22-Window
With your “oriented points” you have to create the two vectors, and then you can make a proper plane.

Or simpler, use Deconstruct Plane to have origin+vectors, and re-combine the plane vector components in a different order…

1 Like

Ok this makes sense, i should know better. But even so, its still giving me a value other than 0 on the first float when i deconstruct the plane… should this not be 0?

in my mind there should only be values greater than 0 on the second float value


All those planes are perpendicular with world XY plane.
So, the normal vector (called “Z”, but it would be better read as “W”) of those planes have the Z component = 0.

If the Z component of the normals were different from 0 that would have meant the planes were facing a little up or down, not perpendicular to world XY.

I’m not sure we are going out from this.

You should practicing with something simpler.

Im sorry that you are not following. transformation matrices are not easy definitely, but this is where world, local (object) and camera space start to appear. Not sure how much consideration in Rhino is needed for this topic. I think you are trying to grasp what im doing internally, when this is for a unrelated topic. I just have a strategy im testing out.

Basically I just want the rotation values between absolute to relative space, from one point to another at any position.( or world space to object space, however you want to define it) If the vector exists at (1,0,0) and I have another vector at (1,1,0), how much do i rotate on the x, y and z axis’s to orient towards that target. Each its own float value that you add to the trasform “stack”.

I only figured there was a solution out there in grasshopper to make it easier.

Look at plugins if you have some difficulties with the maths.
There is a rotate Euler, quaternion … in Pufferfish, or camera Crane in Heteropera. They output planes
image

If you want vectors oriented to origin you can simply plug lines to Unitize vector

If you want add planes from these vectors use plane normal but not aligned
For aligned planes use Create plane from two lines than extract other planes with deconstruct/construct plane

vector issues2.gh (14.2 KB)


With a bit of c# we can get the yaw+pich+roll values:

  private void RunScript(Transform X, ref object yaw, ref object pitch, ref object roll)
  {
    double y = 0;
    double p = 0;
    double r = 0;
    X.Linearize();
    X.GetYawPitchRoll(out y, out p, out r);
    yaw = y;
    pitch = p;
    roll = r;
  }

vector issues_re.gh (14.4 KB)

The rotations from plane system A to plane system B must be done in the correct order Y > P > R
This is only for rotations.

For positions… that is another matter. You can again use world absolute coordinates and relative positions, or use the coordinate system of the start position system.

It really depends on the context…

If also this is not what you needed, I don’t know what else to do…

Riccardo,

I really dont know what to say but THANK YOU! This is amazing… Im self taught in alot that i do, coming from a graphic design background. I owe it mostly to people such as yourself to get me through these moments. These times are hard indeed but you are contributing to the light! Thanks for sticking with me.

much gratitude,

Stephen

PS. A work around ive been doing is setting the target manually. and using a lookAt function to redirect the camera. but this is truely what i wanted.