const cameraDirection = viewer.view.getCamera().getMatrixFromCamera().transform(new Communicator.Point3(0, 0, 1));
getMatrixFromCamera
appears to be deprecated. What do we use instead? I just want to know in which direction the camera is pointing.
Thanks!
tino
3
Hello @mark.aronin,
If you just want to know the direction vector of the current camera, you can subtract the camera position from the camera target, for example:
var cam = hwv.view.getCamera();
var vec = new Communicator.Point3(cam.getTarget().x - cam.getPosition().x, cam.getTarget().y - cam.getPosition().y, cam.getTarget().z - cam.getPosition().z).normalize();
Thanks,
Tino