@@ -197,17 +197,23 @@ public void display(GLAutoDrawable gLDrawable) {
197197
198198 //Point3D normale = /*dir.prodVect(pos);*/getTerrain()
199199 // .calcNormale(pos.getX(), pos.getY()).norme1();
200- Point3D posCam = pos .moins (dir .norme1 ());
200+ Point3D posCam = pos ; // .moins(dir.norme1());
201201 Point3D vertical = camera .getVerticale ().getElem ().norme1 ();
202202 Point3D vert2 = vertical .prodVect (dir ).mult (-1 );
203- glu .gluLookAt (pos .get (0 ), pos .get (1 ), pos .get (2 ),
203+ Point3D positionCamRear = posCam
204+ .plus (camera .getLookat ().moins (posCam ).mult (-0.05 ));
205+
206+ posCam = positionCamRear ;
207+
208+ glu .gluLookAt (posCam .get (0 ), posCam .get (1 ), posCam .get (2 ),
204209 dir .get (0 ), dir .get (1 ), dir .get (2 ),
205210 up .get (0 ), up .get (1 ), up .get (2 ));
206211 /*if(circuit==null)
207212 circuit = mover.getCircuit();
208213 if(circuit!=null)
209214 draw((TRIConteneur)circuit, glu, gl);
210215 */
216+
211217 if (toggleMenu == null )
212218 return ;
213219 if (toggleMenu .isDisplayBonus ()) {
@@ -244,6 +250,9 @@ public void display(GLAutoDrawable gLDrawable) {
244250 displayArcs (glu , gl );
245251 }
246252 if (toggleMenu .isDisplayCharacter ()) {
253+ Cube object = vaisseau .getObject ();
254+ object .setPosition (mover .calcCposition ());
255+ draw (object , glu , gl );
247256 if (getPlotter3D ()!=null &&getPlotter3D ().isActive ()) {
248257 CourbeParametriquePolynomiale courbeParametriquePolynomiale = null ;
249258// TubulaireN2<CourbeParametriquePolynomiale> segmentDroiteTubulaireN2 = new TubulaireN2<>();
@@ -253,9 +262,6 @@ public void display(GLAutoDrawable gLDrawable) {
253262// segmentDroiteTubulaireN2.generate();
254263// draw(courbeParametriquePolynomiale, glu, gl);
255264 } else {
256- Cube object = vaisseau .getObject ();
257- object .setPosition (mover .calcCposition ());
258- draw (object , glu , gl );
259265 }
260266 }
261267
0 commit comments