10
$\begingroup$

I've read the documentation, but am still very unclear as to what the difference is between ViewVector and ViewPoint for Graphics3D. Could someone explain it concisely and clearly enough so that an amateur like myself could understand?

$\endgroup$
7
$\begingroup$

If ViewVector is set to be Automatic it will be the vector that starts at ViewPoint and ends at ViewCenter, which means that ViewVector and ViewPoint are tied to each other.

You can think of the origin of ViewVector as the position where the camera filming the scene is located, and its direction as what direction it points in.

So as long as ViewVector is automatic you can implicitly set the ViewVector by positioning ViewPoint and ViewCenter, ViewVector will just be the vector between those two points. However if you change ViewVector that change will override any changes that you've made to ViewPoint and ViewCenter.

One important difference, as Kuba says, is that ViewCenter deals with relative coordinates, not absolut ones. ViewVector uses actual points in the room, but ViewCenter uses a fraction of the plot range. So if the plot range is {100, 200, 300} then ViewCenter -> {0.5, 0.5, 0.5} puts the view center at {50, 100, 150}.

$\endgroup$
  • $\begingroup$ So basically if you only set ViewVector->{1,1,1} that's identical to setting the ViewPoint? $\endgroup$ – Aron Apr 17 '14 at 13:30
  • 1
    $\begingroup$ Yes, I believe so. $\endgroup$ – C. E. Apr 17 '14 at 14:02
  • 1
    $\begingroup$ I have not realised that before this question appeared but the important difference is that ViewPoint can't handle absolute coordinates, so ViewVector is not just doublind the functionality but allowes that. The point is, it's worth to stress this :) $\endgroup$ – Kuba Apr 20 '14 at 7:16
  • $\begingroup$ @Kuba Good point, it was definitely something I should have mentioned to begin with. Added it. $\endgroup$ – C. E. Apr 20 '14 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.