Thanks for your reply @bghgary ! oh ya, i just realized: only if the console is open before i press ‘run’ the output values match the ones i added to the post. if i hit run first (or just open the page) i get the same result as you do. but in both cases - if i delete the last setTarget() block -
or something deeper than that.
As a get function it shouldn’t change anything, but it clearly does.
uncomment any camera.getViewMatrix and it messes the camera up.
Update…
Upon some further investigation, it seems multiple functions are affected, including setTarget as you wrote.
Looks like the cache isn’t updated and old values being used perhaps?
The getViewMatrix() call is also updating internal and external computed properties like position (as the position of an ArcRotateCamera is based on alpha, beta and radius).
For user convenience the camera.position is computed out of alpha, beta and radius as soon as the viewMatrix is built (it is easy and fast to extract that info from the matrix itself)
In the repro shared by @bghgary, the getViewMatrix call will update the position property which in turn is used by the setTarget call (as the setTarget call will compute alpha, beta and radius from position and target).
So if you call setTarget BEFORE getViewMatrix all is fine as camera postion was not yet moved.
Maybe it’s the same, I would just assume a setTarget would simply change the target property and update alpha/beta/radius to keep the same position or atleast the same angle & distance