70 opengl::CGridPlaneXY::Create(-20, 20, -20, 20, 0, 1);
71 obj->setColor(0.8f, 0.8f, 0.8f);
72 theScene->insert(obj);
81 obj->enableTickMarks();
82 obj->setAxisLimits(-10, -10, -10, 10, 10, 10);
83 theScene->insert(obj);
88 obj->setColor(0, 0, 1);
90 obj->setLocation(0, 0, 1);
91 obj->setName(
"ball_1");
92 theScene->insert(obj);
99 win.unlockAccess3DScene();
102 win.addTextMessage(0.01, 0.85,
"This is a 2D message", 0 );
104 win.setCameraElevationDeg(25.0f);
107 win.addTextMessage(0.7, 0.9,
"Press 'h' for help", 1 );
110 cout <<
"Control with mouse or keyboard. Valid keys:" << endl;
111 cout <<
" ESC -> Exit" << endl;
112 cout <<
" Left/right cursor arrow -> Camera azimuth" << endl;
120 while (!
end &&
win.isOpen())
126 const double t = timer.
Tac();
128 const double W = 5.0, Q = 3.3;
130 R * cos(W * t) * sin(Q * t),
R * sin(W * t),
131 R * cos(W * t) * cos(Q * t));
138 win.unlockAccess3DScene();
142 std::this_thread::sleep_for(1ms);
148 int key =
win.getPushedKey(&kmods);
154 if (key ==
'h' || key ==
'H')
156 std::cout <<
"These are the supported commands:\n"
157 " - 'h': Toogle help view\n"
158 " - '<-' and '->': Rotate camera\n"
159 " - 'Alt+Enter': Toogle fullscreen\n"
165 win.setCameraAzimuthDeg(
win.getCameraAzimuthDeg() + 5);
167 win.setCameraAzimuthDeg(
win.getCameraAzimuthDeg() - 5);
181 std::this_thread::sleep_for(50ms);
184 catch (
const std::exception& e)
191 printf(
"Untyped exception!!");