Replies: 1 comment
-
Edited as I realized my fiddle was using 2.7 and on 2.9 the below works Looking at the So I'd really need to take the orbit target and add my desired look vector?
I think it would be nice to have a built in for this as I imagine wanting to align the camera straight on an axis is pretty common or along some arbitrary world vector. Any thoughts on adding something like:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Solved - but I do have a further question in my comment below
Posting as a discussion as I might just not understand
lookInDirectionOf
's intent.To start, here is a JSfiddle with an example of the current behavior and what I'd expect:
https://jsfiddle.net/o9sqxyLj/40/
I'm trying to use it for camera orientation (top/left/right/bot/front/back). This works well until I pan/truck the camera and its target is no longer the world origin. In that case, the rotation acts as if its still trying to look at the world origin?
The example uses an ortho camera, and if looking down a single axis, you should only see a single face of the cube.
Scenario 1: Camera orbiting world origin
If I call
lookInDirectionOf(0,0,1)
it works correctly showing only one face:Scenario 2: Truck camera left
Truck left with
truck(-5, 0)
:Now when calling
lookInDirectionOf(0,0,1)
, it gives a weirdly rotated view:Is this
lookInDirectionOf
not a world vector? I don't quite understand how it works and I'm guessing the vector is really from a different coordinate system. Is there a better function I should be using to set the camera's look direction in world coordinates? If not, I think this functionality should be supported as I can see this being a common thing people want to do.I also included a button for what my expected output would be. If you press the buttons in this order you can see the actual vs expected result:
Expected Output:
Beta Was this translation helpful? Give feedback.
All reactions