Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am trying to use Mathematica to illustrate mixed strategies in Game Theory. I want my students to be able to use common joysticks as controllers. What I find, however, is that in addition to doing what I want, moving one of the controls on my gamepad rotates the 3D graphics in such a way as to ruin the presentation. Basically, all I want the controls to do is change the strategy each player uses. The Graphics3D object should not rotate. Here's a very simplified of the code that illustrates the undesired behavior.

Manipulate[
Column[{x, y, 
Show[Graphics3D[{Line[{{x, y, 0}, {x + 1, y + 1, 1}}]}, 
 Axes -> True, ImageSize -> 400], 
     Graphics3D[{Tube[{{x, y, 0}, {x - 1, x - y, 1}}]}]]}], 
"X1" -> {{x, 0.71}, 0, 1}, "Z1" -> {{y, 0.5}, 0, 1}, 
ControllerPath -> "Joystick"]

Mathematica graphics

I also thought it might be useful to show you the following, which is the results from

ControllerState["PLAYSTATION(R)3 Controller", "Mapping"]

(* {"X2" -> "Z Axis", "Y2" -> -"Z Rotation", "JB" -> "Button 11", 
 "JB1" -> "Button 11", "JB2" -> "Button 12", "JB3" -> None, 
 "TLB" -> "Button 5", "TRB" -> "Button 6", "BLB" -> "Button 7", 
 "BRB" -> "Button 8", "X" -> "X Axis", "Y" -> -"Y Axis", 
 "Z" -> "Z Axis", "X1" -> "X Axis", "Y1" -> -"Y Axis", 
 "Z1" -> "Z Axis", "X2" -> "Z Rotation", "Y2" -> -"Slider", 
 "Z2" -> None, "X3" -> "Hatswitch X Axis", 
 "Y3" -> -"Hatswitch Y Axis", "Z3" -> None, 
 "X4" -> Switch[{"Button 1", "Button 3"},
   {False, False}, 0,
   {True, False}, -1,
   {False, True}, 1,
   {True, True}, 0.00001], "Y4" -> Switch[{"Button 2", "Button 4"},
   {False, False}, 0,
   {True, False}, -1,
   {False, True}, 1,
   {True, True}, 0.00001], "X5" -> Switch[{"Button 7", "Button 5"},
   {False, False}, 0,
   {True, False}, -1,
   {False, True}, 1,
   {True, True}, 0.00001], "Y5" -> Switch[{"Button 8", "Button 6"},
   {False, False}, 0,
   {True, False}, -1,
   {False, True}, 1,
   {True, True}, 0.00001], "X6" -> Switch[{"Button 9", "Button 10"},
   {False, False}, 0,
   {True, False}, -1,
   {False, True}, 1,
   {True, True}, 0.00001], "B1" -> "Button 1", "B2" -> "Button 2", 
 "B3" -> "Button 3", "B4" -> "Button 4", "B5" -> "Button 5", 
 "B6" -> "Button 6", "B7" -> "Button 7", "B8" -> "Button 8", 
 "B9" -> "Button 9", "B10" -> "Button 10", "B11" -> "Button 11", 
 "B12" -> "Button 12", "DefaultAbsolute" -> False} *)

Also, for what it's worth, the Sony Playstation gamepad I am using has two main analog controls that appear to move in at least a left right and up down configuration. Moving the left control left and right appears to correspond to "X1" and moving the right control left and right appears to correspond to "Z1". I'm hoping my problem is not Sony PS3 controller specific but is due to some lack of understanding on my part about how to map the physical controls to Mathematica behavior.

share|improve this question
By adding ViewPoint -> {1.3, -2.4, 2} (the default setting) to each Graphics3D object you get a partial solution. It still rotates if you press directly up or down on the left joystick. I am not sure as to why as of yet. – James Rohal Mar 21 at 18:46

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.