[solved] camera.getWorldDirection doesn't always work

In one of 2 cases camera.getWorldDirection doesn’t work, and instead it returns a value close to zero like if I had set the camera to look at the origin, while the camera helper looks elsewhere.

Note that the camera is a child of a short chain of object3D objects, and camera.getWorldPosition does work.

I’ve spend more than 5 hours (now it’s 5:40AM) trying to figure out why it works in one case, and why it doesn’t work in the other one in order to proceed with my project, to no avail.

Before I spend another 10 hours or so, is there a known issue with getWorldDirection, or is there an alternative?

A demo would be nice.
Keep in mind, getWorldDirection returns a normalized vector.


Thanks for the response, when I added the camera position to the vector returned from getWordDirection, it worked. The other case was working from the beginning, because it was based on origin.

I think that returning a normalized vector as “direction” is semantically wrong, because that’s a vector returned with the same orientation, NOT direction, direction as the word implies means to be directed specifically towards something, so any vector that isn’t aligned with the same axis, is directed at something different, hence it “sees” a different part of the scene.

Cambridge dictionary:
Direction: the position towards which someone or something moves or faces
Orientation: the position of something in relation to its surroundings:

A framework that tries to imitate the real world, or a similar one, shouldn’t be cold-blooded theoretical math termed, it should adopt more real-world language.

So lesson learned: don’t assume human intuitiveness.