I have a simple FK control rig for my character’s eyes.
I want to be able to draw a line from the eye out in the direction the character is looking, ie along the forward vector.
How would I calculate the end point to plug into the B vector input of a Draw node?
Get the Rotation and call Forward() on it.
If the rotation is in local space, then you need to also transform it by the world space of its parent.
Also, what counts as “forward” to you may be “sideways” for the art, and if so, you need to use one of “Left” or “Right” or “Backward” vectors instead.
Separate, unrelated, suggestion:
To make screen shots, on Windows, use Win-Shift-S, which starts the Snippings tool which lets you select a rectangle from the screen to copy to clipboard.
To do the same thing on MacOS, use Clover-Shift-4.
This will be a lot easier to manage and read than a phone snapshot of a screen. It’s also easier to paste straight from clipboard into the forum!
I’m not able to find where I call Forward() on it.
Could you give me more details?
I’ve pulled out from the quarternion rotation of the Control but am not finding a forward vector option like you have in a normal blueprint.
I’m also using 4.27…
Thanks for the suggestion for screen shots. I’m unfortuantely using a locked down box (not connected to the internet), hence the nasty phone picture!
I hate it when that happens. At least it’s in a location where you are allowed to bring your phone …
Can’t you break your transform and get the rotation?
Oh, wait, control rig context. And, yes, you can’t break transforms there. Annoying!
You could make a constant variable named “Forward” that contains (1, 0, 0) or whatever, and rotate that with the rotator; that would work.
Perhaps simpler is to use the basis vectors of the matrix. “X” is generally “forward” and Y is generally “right” and Z is generally “up” assuming you’re in the canonical Unreal left-handed Z-up, X-forward coordinate space. (Else, pick the other vector and negate as needed …)
Thanks so much for this.
As I’m using 4.27 (which doesn’t have the Matrix math nodes), I went ahead with making a variable called “Forward” and rotated it and then put it into a Draw Line node.
However, this is drawing 2 lines rather than the 1 I usually get from this node. One line is correct and moves with the forward/eyeline direction when I rotate. The second, incorrect line moves with the rotation but at the fraction of the correct angle.
Do you have any thoughts on how I fix this?
Note: My success with the Draw Line node has always been when I have an aim set up (so the bone aims towards the control and then I input each translation into the Draw Line, I’m wondering if this issue is because I’m directly setting the Bones to Controls).