-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raycaster.prototype.setFromCamera() support for cameras with matrix-defined position #6230
Conversation
Hmmm... The |
Are you setting |
Yes, in which case camera.position doesn't necessarily reflect the camera's position. If camera.matrix is what the renderer uses, then the position extracted from camera.matrix will always be accurate. |
If we were to support changing the matrix directly, then every method that relies on rotation information must have two logic paths -- one to get it from the matrix, and one to get it from the rotation vector or quaternion. If an object is not static, the user must manipulate the object by changing its That being said, I think this method can be improved -- but not for your reason. I'll think about the implications of the following change, instead:
In the mean time, I suggest you change your methodology to avoid potential pitfalls. |
Yeah. I mean, you can update
It's the same issue. By the time the user is calling that method we can't guarantee that |
This has always been a problem in three.js. Note that in this case, In (many) other methods such as |
For the use of My understanding is that when Are there other uses for |
Oh. Sorry... I forgot that this is done per frame... Still, what can happen is that |
Dear Densaugeo & mrdoob & WestLangley, We are working on identifying redundant development and duplicated pull requests. We have found there is a pull request: #6301 which might be duplicated to this one and already merged into main stream. So maybe this pull request should be closed. We would really appreciate if you could help us to validate and give us some feedback. Sincerely, |
Closing. This feature was duplicated and merged in #6301. |
Raycaster.prototype.setFromCamera() was getting the camera's position from camera.position, which isn't updated on cameras that are moved around by direct matrix transform.
I believe grabbing it the position from camera.matrix still gives an accurate position for cameras that use the position property. At least, the canvas_interactive_cubes example still works.