How does one fix a Graphics3D display?
- To: mathgroup at smc.vnet.net
- Subject: [mg113642] How does one fix a Graphics3D display?
- From: Joseph Gwinn <joegwinn at comcast.net>
- Date: Fri, 5 Nov 2010 05:14:53 -0500 (EST)
- Organization: Gwinn Instruments
I'm using a 3dconnexion "SpaceNavigator" 3-D mouse (works like the old SpaceBall joystick), and am running into an annoying problem. I have a simple DynamicModule that accepts and integrates the XYZ inputs from the SpaceNavigator, and uses the integral to move a little sphere around in a 3D box. So far so good. But I cannot get the box to stay still. Matheamtica keeps trying to help me by recomputing what it thinks is the best way to view the scene, which leads to disorienting jumps in the box and the viewpoint. So, the question is how to convince Mathematica to keep the box fixed and let the little sphere fly around within this cage? I have tried many variations of the View* options, to no avail. For the record, here is some sample code. You will need some kind of 3D controller for this code to work. DynamicModule[{x=0,y=0,z=0}, Graphics3D[ {Dynamic[Text[ToString[{x,y,z}],{0,0,10}]],Sphere[Dynamic[{x,y,z}+= {1,1,-1}*ControllerState["SpaceNavigator",{"X Axis","Z Axis", "Y Axis"}]],0.35]},PlotRange->{{-10,+10},{-10,+10},{-10,+10}}, Axes->True,Ticks->False,AxesLabel->{"x","y","z"},ViewPoint->Front, ViewVertical->{0,0,1},ViewCenter->{0,0,0},ViewVector->{{0,30,0},{0,-1,0}} ] ] Thanks in advance, Joe Gwinn