MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Why are my 3D plots blue?

  • To: mathgroup at
  • Subject: [mg114210] Why are my 3D plots blue?
  • From: Joseph Gwinn <joegwinn at>
  • Date: Sat, 27 Nov 2010 03:36:43 -0500 (EST)

I've noticed an apparently harmless but mystifying oddity.  

I have some Graphics3D plots that contain an object that is being moved 
and rotated by a 3D mouse (a SpaceNavigator).  If the view as initially 
determined by Graphics3D does not change, one can move the object around 
forever with no blue.  

If the view is changed (either by direct mouse click-and-drag action to 
rotate the bounding box, or automatically as Graphics3D computes a 
better view), the entire plot window will become see-through pastel 
blue, the same shade as is used to mark the bracket of a selected cell. 

If one selects the cell manually before using the 3D mouse to spin the 
object, the plot does not go blue.

In all cases, this is within a DynamicModule and ControllerState is 
being used to obtain the datastream from the 3D mouse.  There are no 
messages or errors reported when the plot goes blue.

Does anyone know what's going on?  Somehow, the plot is being selected.  
One assumes that once the cause is understood, it will be obvious how to 
prevent this annoyance.


Joe Gwinn

For the record, here is the code of one miscreant:


{xr,yr,zr}=-5ControllerState["SpaceNavigator",{"X Rotation","Z 
Rotation","Y Rotation"}]^3;
qxr=Q[Cos[xr/2],Sin[xr/2],0,0];  (* Generate the X-axis rotation 
quaternion *)
qyr=Q[Cos[yr/2],0,Sin[yr/2],0];  (* Generate the Y-axis rotation 
quaternion *)
qzr=Q[Cos[zr/2],0,0,Sin[zr/2]];  (* Generate the Z-axis rotation 
quaternion *)
qd=qzr**qyr**qxr**qd;  (* Apply the composite rotation to the current 
direction *)
{xd,yd,zd}=SWproduct[{0,0,1},qd];  (* Sandwich product computes the 
direction vector *)
,yd,zd}},0.1]],Text["Log10 Abs Q Norm error= 
,Text[ToString[qd],{0,0,-10}] ,Text["DirVec= 
,PlotRange->{{-10,+10},{-10,+10},{-10,+10}},PlotLabel->"Translation plus 

End code.  SWproduct[] uses a quaternion to rotate an ordinary vector.

  • Prev by Date: Re: Compile and arrays
  • Next by Date: Re: disappointing CUDA speed
  • Previous by thread: Re: Defining constants causes integration to hang
  • Next by thread: Re: Why are my 3D plots blue?