Showing the changes to interface/src/main.cpp (1 of 5 files). Show all
Unified · Split
| @@ -511,6 +511,9 @@ void simulateHead(float frametime) · 510 unmodified lines | |||
| 511 | } | 511 | } |
| 512 | } | 512 | } |
| 513 | 513 | ||
| 514 | |||
| 515 | |||
| 516 | |||
| 514 | // XXXBHG - this code is not yet working. This is here to help Jeffery debug getAvatarHeadLookatDirection() | 517 | // XXXBHG - this code is not yet working. This is here to help Jeffery debug getAvatarHeadLookatDirection() |
| 515 | // The code will draw a yellow line from the avatar's position to the origin, | 518 | // The code will draw a yellow line from the avatar's position to the origin, |
| 516 | // It also attempts to draw a cyan line from the avatar to 2 meters in front of the avatar in the direction | 519 | // It also attempts to draw a cyan line from the avatar to 2 meters in front of the avatar in the direction |
| @@ -528,7 +531,35 @@ void render_view_frustum() { · 11 unmodified lines | |||
| 528 | // farDist – the distance from the camera to the far plane | 531 | // farDist – the distance from the camera to the far plane |
| 529 | // farHeight – the height of the far plane | 532 | // farHeight – the height of the far plane |
| 530 | // farWidth – the width of the far plane | 533 | // farWidth – the width of the far plane |
| 534 | |||
| 535 | |||
| 536 | //Jeffrey's variation: | ||
| 537 | glm::vec3 avatarBodyPosition = myHead.getAvatarPosition(); | ||
| 538 | glm::vec3 avatarHeadPosition = myHead.getAvatarHeadPosition(); | ||
| 539 | glm::vec3 avatarHeadDirection = myHead.getAvatarHeadLookatDirection(); | ||
| 540 | |||
| 541 | glm::vec3 avatarHeadDirectionEndPoint( avatarHeadPosition ); | ||
| 542 | avatarHeadDirectionEndPoint += avatarHeadDirection; | ||
| 543 | |||
| 544 | glDisable(GL_LIGHTING); | ||
| 545 | glLineWidth( 3.0 ); | ||
| 546 | |||
| 547 | // line from avatar head to origin | ||
| 548 | glBegin( GL_LINE_STRIP ); | ||
| 549 | glColor4f( 1.0, 0.0, 0.0, 1.0 ); | ||
| 550 | glVertex3f( avatarBodyPosition.x, avatarBodyPosition.y, avatarBodyPosition.z ); | ||
| 551 | glVertex3f( 0.0f, 0.0f, 0.0f ); | ||
| 552 | glEnd(); | ||
| 531 | 553 | ||
| 554 | //line from avatar head to 1 meter in front of avatar head | ||
| 555 | glBegin( GL_LINE_STRIP ); | ||
| 556 | glColor3f( 0.0f, 1.0f, 1.0f ); | ||
| 557 | glVertex3f( avatarHeadPosition.x, avatarHeadPosition.y, avatarHeadPosition.z ); | ||
| 558 | glVertex3f( avatarHeadDirectionEndPoint.x, avatarHeadDirectionEndPoint.y, avatarHeadDirectionEndPoint.z ); | ||
| 559 | glEnd(); | ||
| 560 | |||
| 561 | |||
| 562 | /* | ||
| 532 | glm::vec3 cameraPosition = ::myHead.getPos()*-1.0; // We need to flip the sign to make this work. | 563 | glm::vec3 cameraPosition = ::myHead.getPos()*-1.0; // We need to flip the sign to make this work. |
| 533 | glm::vec3 cameraDirection = ::myHead.getAvatarHeadLookatDirection()*-1.0; // gak! Not sure if this is correct! | 564 | glm::vec3 cameraDirection = ::myHead.getAvatarHeadLookatDirection()*-1.0; // gak! Not sure if this is correct! |
| 534 | 565 | ||
| @@ -550,7 +581,9 @@ void render_view_frustum() { · 15 unmodified lines | |||
| 550 | glColor3f(0,1,1); | 581 | glColor3f(0,1,1); |
| 551 | glVertex3f(cameraPosition.x,cameraPosition.y,cameraPosition.z); | 582 | glVertex3f(cameraPosition.x,cameraPosition.y,cameraPosition.z); |
| 552 | glVertex3f(lookingAt.x,lookingAt.y,lookingAt.z); | 583 | glVertex3f(lookingAt.x,lookingAt.y,lookingAt.z); |
| 553 | 584 | */ | |
| 585 | |||
| 586 | |||
| 554 | /* | 587 | /* |
| 555 | // Not yet ready for this... | 588 | // Not yet ready for this... |
| 556 | glm::vec3 up = glm::vec3(0.0,1.0,0.0); | 589 | glm::vec3 up = glm::vec3(0.0,1.0,0.0); |
| @@ -727,7 +760,7 @@ void display(void) · 170 unmodified lines | |||
| 727 | //--------------------------------------------- | 760 | //--------------------------------------------- |
| 728 | // draw a grid gound plane.... | 761 | // draw a grid gound plane.... |
| 729 | //--------------------------------------------- | 762 | //--------------------------------------------- |
| 730 | //drawGroundPlaneGrid( 5.0f, 9 ); | 763 | drawGroundPlaneGrid( 5.0f, 9 ); |
| 731 | 764 | ||
| 732 | 765 | ||
| 733 | // Draw cloud of dots | 766 | // Draw cloud of dots |