Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Prevent error message on accidental mouse drag on dynamic 3d graphics

Here is an example how to use Dynamic inside Manipulate for smooth rotation. But it does not work for the following code.

Manipulate[
 Show[Graphics3D[Cube[]], 
  ViewPoint -> 
   RotationMatrix[Dynamic@fi, 
     RotationMatrix[Dynamic@fi, {0, 1, 1}] . {0, 0, 
       1}] . {1.3`, -2.4`, 2.`}], {fi, 0, 2 Pi}]

It can be solved by wrapping whole view point expression by Dynamic instead of using Dynamic@fi.

Manipulate[
 Show[Graphics3D[Cube[]], 
  ViewPoint -> 
   Dynamic[RotationMatrix[fi, 
      RotationMatrix[fi, {0, 1, 1}] . {0, 0, 1}] . {1.3`, -2.4`, 
      2.`}]], {fi, 0, 2 Pi}]

But then if you accidently click and drag the graphics by mouse an error message is thrown.

How to prevent this?

Answer*

Cancel