Absolute Object3D.lookAt?
See original GitHub issuewhile working on #1535, and revising #1188, I realized the need to understand converting between global <–> local coordinates.
in THREE.Object3D.lookAt, a TODO is commented
// TODO: Add hierarchy support
do we want the behavior to be object.lookAt(absolutePosition)? Would anyone like to check if these calculations are correct?
// Insert right after lookAt: function ( vector ) {
// Make sure scene matrix are updated
// scene.updateMatrixWorld();
var targetMatrix = new THREE.Matrix4().setPosition(vector);
var objMatrixWorldInverse = new THREE.Matrix4().getInverse(this.parent.matrixWorld);
targetMatrix.multiply(targetMatrix, objMatrixWorldInverse);
vector.getPositionFromMatrix( targetMatrix );
Issue Analytics
- State:
- Created 11 years ago
- Comments:25 (17 by maintainers)
Top Results From Across the Web
Object3D#lookAt – three.js docs
Object3D. This is the base class for most objects in three.js and provides a set of properties and methods for manipulating objects in...
Read more >lookat object3d method with apply euler Vector3 ... - YouTube
For this threejs example I just wanted to get a visual idea of how the look at method of the object3d class works...
Read more >Three.js update rotation of grandchild of Object3D
I'm trying to get the grandchild of a rotated Object3D element to lookAt() the camera. I've tried a lot of approaches. The source...
Read more >Object3D - Away3D FP10 V3.6.0 API Documentation
Calulates the absolute distance between the local 3d object position and the position of the given 3d object. Object3D. lookAt(target:Vector3D ...
Read more >flexible THREE.Object3D.lookAt - JSFiddle - Code Playground
lookAt (0, 0, 0);. 20. . 21. const scene = new THREE.Scene(); ... Object3D();. 59. scene.add(tank); ... position: absolute;.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

idk… but the behavior of this method is weird.
Not sure…
If it had to sit in the application layer it would look like this:
And with the new method: