Changeset 10236 in orxonox.OLD for branches/camera
- Timestamp:
- Jan 14, 2007, 9:35:08 PM (18 years ago)
- Location:
- branches/camera/src/world_entities
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camera/src/world_entities/blackscreen.cc
r10220 r10236 108 108 glEnable(GL_BLEND); // Turn Blending On 109 109 110 110 // 111 // Coord schould depend on CameraTarget 112 // 113 // 114 // 111 115 112 116 glColor4f(0, 0, 0, i); -
branches/camera/src/world_entities/camera.cc
r10206 r10236 22 22 #include "shell_command.h" 23 23 #include "targets.h" 24 #include <iostream.h> 24 25 25 26 26 … … 324 324 void CameraTarget::detach() 325 325 { 326 glLoadIdentity(); 327 328 //Movemet 329 State::getCameraNode()->setParentSoft(PNode::getNullParent()); 330 331 //LookAt 332 // State::getCameraTargetNode()->setParentSoft(PNode::getNullParent()); 326 State::getCameraNode()->setParentSoft(target); 327 State::getCameraTargetNode()->setParentSoft(target); 333 328 } 334 329 … … 344 339 State::getCameraTargetNode()->setParentSoft(object); 345 340 } 341 342 346 343 347 344 … … 366 363 glLoadIdentity(); 367 364 target->shiftCoor(speed*tmpVec.x, speed*tmpVec.y, speed*tmpVec.z); 368 // cout << "%%" << tmpVec.x << "%%";369 365 370 366 } … … 403 399 void CameraTarget::test() 404 400 { 405 401 glLoadIdentity(); 406 402 407 403 atach(target); 408 404 409 //tar->setRelCoorSoft(1000,1000,1000);410 411 412 //Vector* vec=new Vector(5000,5000,5000);413 //translateNow(vec);414 //glMatrixMode (GL_MODELVIEW);415 //glLoadIdentity();416 //glTranslatef(100, 100, 100);417 // State::getCamera()->getTargetNode()->setRelCoor(100,100,100);418 405 } 419 406 … … 422 409 { 423 410 trans(-200, 0, 0); 424 //target->setAbsCoor(target->getAbsCoorX()-200, target->getAbsCoorY(), target->getAbsCoorZ()); 425 } 426 427 411 } 412 413 -
branches/camera/src/world_entities/camera.h
r10206 r10236 95 95 float speed; 96 96 PNode* target; 97 PNode* freeTarget; 97 98 98 99 public: -
branches/camera/src/world_entities/cameraman.cc
r10206 r10236 26 26 currentCam=State::getCamera(); 27 27 this->cameras.push_back(currentCam); 28 currentCam->target->detach(); 28 29 29 30 } … … 34 35 Camera* newCamera=new Camera(); 35 36 this->cameras.push_back(newCamera); 36 //cameraList.size(); 37 //cameraList[4] 37 newCamera->target->detach(); 38 38 } 39 39 … … 64 64 void cameraman::changeTarget(int camNo, PNode* target) 65 65 { 66 cameras[camNo]-> target->atach(target);66 cameras[camNo]->lookAt(target); 67 67 } 68 68 69 69 70 70 void cameraman::changeCurrTarget(PNode* target) 71 { 72 currentCam->lookAt(target); 73 } 74 75 void cameraman::atachCurrTarget(PNode* target) 71 76 { 72 77 currentCam->target->atach(target); -
branches/camera/src/world_entities/cameraman.h
r10206 r10236 22 22 void changeTarget(int camNo, PNode* target); 23 23 void changeCurrTarget(PNode* target); 24 void atachCurrTarget(PNode* target); 24 25 void jumpCam(int x, int y, int z, int camNo); 25 26 void jumpCurrCam(int x, int y, int z); -
branches/camera/src/world_entities/test_entity.cc
r10212 r10236 25 25 26 26 27 #include "material.h"28 29 27 #include "state.h" 30 28 … … 35 33 CREATE_FACTORY(TestEntity); 36 34 37 float i=0; 38 bool state=1; 35 39 36 40 37 /** … … 73 70 this->registerObject(this, TestEntity::_objectList); 74 71 this->toList(OM_GROUP_00); 72 CM= new cameraman(); 73 test(); 74 } 75 75 76 /*this->material = new Material(); 77 this->material->setIllum(3); 78 this->material->setDiffuse(1.0,1.0,1.0); 79 this->material->setSpecular(0.0,0.0,0.0); 80 this->material->setAmbient(1.0, 1.0, 1.0); 81 this->material->setDiffuseMap("maps/TE2.tga");*/ 76 void TestEntity::test() 77 { 78 CM->moveCurrCam(-200, 0, 0); 79 CM->createCam(); 80 CM->moveCam(0, -200, 0, 1); 82 81 } 82 83 83 84 84 … … 94 94 void TestEntity::draw() const 95 95 { 96 // if(!mediaLoaded)97 // false;98 96 99 // glPushAttrib(GL_ENABLE_BIT);100 // glDisable(GL_LIGHTING);101 // glDisable(GL_BLEND);102 //103 // glEnable(GL_TEXTURE_2D);104 // glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));105 106 // glPushMatrix();107 /* glTranslatef (this->getAbsCoor ().x,108 this->getAbsCoor ().y,109 this->getAbsCoor ().z);110 glRotatef(axis, 0.0f, 1.0f, 0.0f);*/111 //PRINTF(0)("axis: %f\n", axis);112 //glEnable(GL_BLEND); // Turn Blending On113 114 115 116 //glColor4f(0, 0, 0, i);117 118 // glBegin(GL_QUADS);119 // glVertex3f(-1.0f, -100.0f, -100.0f);120 // glTexCoord2f(1.0f, 1.0f);121 // glVertex3f(-1.0f, -100.0f, 100.0f);122 // glTexCoord2f(0.0f, 1.0f);123 // glVertex3f(-1.0f, 100.0f, 100.0f);124 // glTexCoord2f(0.0f, 0.0f);125 // glVertex3f(-1.0f, 100.0f, -100.0f);126 // glTexCoord2f(1.0f, 0.0f);127 128 // glEnd();129 130 // glPopMatrix();131 // glPopAttrib();132 97 } 133 98 … … 137 102 void TestEntity::tick (float time) 138 103 { 139 // if (state==0 && i==1) 140 // i=0; 141 // if (state==1 && i<=1) 142 // i=i+0.005; 104 143 105 } 144 106 … … 146 108 void TestEntity::changeState (bool sta) 147 109 { 148 state=sta; 110 149 111 } -
branches/camera/src/world_entities/test_entity.h
r10065 r10236 3 3 4 4 #include "world_entity.h" 5 #include "cameraman.h" 5 6 6 7 class TiXmlElement; … … 13 14 private: 14 15 15 Material* material;16 cameraman* CM; 16 17 17 18 public: … … 22 23 void init(); 23 24 virtual void loadParams(const TiXmlElement* root); 24 25 void test(); 25 26 void changeState (bool); 26 27 virtual void tick (float time);
Note: See TracChangeset
for help on using the changeset viewer.