~Camera: Focal Point Sphere


How to put a SPHERE 100 units in front of free camera, to mark the focal point?

Normalize target of camera to get vector of view. Then would we add or subtract or multiply on the vector to get the position for the sphere?

: )


1 Like

getFrontPosition() ???

Too easy!

I’ll step into that function to see add, subtract, multiply…

drumroll… :drum:

It is subtract… then normalize vector, then scale and then add? Awesome.

        TargetCamera.prototype.getFrontPosition = function (distance) {
            var direction = this.getTarget().subtract(this.position);
            return this.globalPosition.add(direction);

I will need read up in docs and try each, to imagine how add, subtract , and scale do this.

PG is helpful. Maybe I’ll override and turn off one at a time…

Thx Pryme8!

1 Like