I am exploring the use of Dynamic variables for the ViewPoint and ViewVertical options in a Graphics3D object. I have the following code:

vp = {0, -5, 0}
vv = {0, 0, 1}
(* Cell break here to make changes in vp and vv a bit easier *)
img = Graphics3D[{Yellow, Cuboid[{0, 0, 0}, {1, 3, 1}], Blue, 
  Cuboid[{2, 1, 1}, {4, 2, 3}]}, SphericalRegion -> True, 
  Lighting -> "Neutral", ViewPoint -> Dynamic[vp],
  ViewVertical -> Dynamic[vv]]
(* Another cell break, but hopefully making cut and paste easier by adding comments *)
{ViewVertical, ViewPoint} /. AbsoluteOptions[img]

There are two things that bother me:

  1. The AbsoluteOptions line throws an error ViewPoint::nlist3 is not a list of numbers. I presume this is because the Head of vp is Dynamic. This error isn't thrown for ViewVertical, however, which I would expect should complain as well. Am I missing something, or can the ViewVertical error be safely ignored? (I don't like quieting errors for fear of covering up something later on down the line.)
  2. Because of the dynamic head, operations on vv and vp require a bit of manipulation. For example, in the next bit of code, the first line doesn't work and the second line does, but obviously the dynamic evaluation has been lost:


Norm[ViewVertical /. AbsoluteOptions[img]]
Norm[(ViewVertical /. AbsoluteOptions[img]) /. {Dynamic -> List}]

Again, I worry about my hack to change Dynamic into a List isn't the most elegant (or safe) way to gain access to these values. Furthermore, I envision wanted to maintain the Dynamic nature of the data manipulation. Any suggestions would be welcome.

P.S. I have looked here for some guidance, and while helpful in framing the picture, I'm still a bit confused with the use of Dynamic in this case.

  • $\begingroup$ Why do You need to use AbsoluteOptions if those values are in vv and vp and Norm@vp is enough? If You just want to extract those values it seems to be a duplicate $\endgroup$
    – Kuba
    Commented Jun 26, 2013 at 18:09
  • $\begingroup$ @Kuba Heh, it looks like you caught me just copying and pasting examples without giving much thought to what I'm doing. $\endgroup$ Commented Jun 26, 2013 at 18:13

1 Answer 1


Ignoring Kuba's Gordian Knot solution (let's just pretend he never said anything), I think the idiomatic function here would be Setting, which "collapses" Dynamic expressions:

{ViewVertical, ViewPoint} /. AbsoluteOptions[Setting[img]]

This can in turn be dynamic:

Dynamic[{ViewVertical, ViewPoint} /. AbsoluteOptions[Setting[img]]]

Neither of these trigger the ViewPoint error, which is pretty quirky. Just doing AbsoluteOptions[img] gives that error.


Sidenote, also check out DynamicSetting, which has some nifty debugging/development uses (see the color swatch example here).

  • $\begingroup$ I'm glad You ignored me because this answer is educational :). $\endgroup$
    – Kuba
    Commented Jun 26, 2013 at 18:25
  • $\begingroup$ Thanks. I was unfamiliar with Setting and the dynamic version. $\endgroup$ Commented Jun 26, 2013 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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