Changeset 6935 for OpenSceneGraph/trunk/examples/osgmovie/osgmovie.cpp
- Timestamp:
- 06/12/07 10:29:32 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgmovie/osgmovie.cpp
r6625 r6935 293 293 if (arguments.read("--collar", collar_radius)) {} 294 294 295 double rotationDegrees = 180.0; 296 if (arguments.read("--rotation", rotationDegrees)) {} 297 295 298 osg::Vec3d center(0.0,0.0,0.0); 296 299 osg::Vec3d eye(0.0,0.0,0.0); … … 331 334 osg::Vec3 dy = yAxis*(height/((float)(noSteps-1))); 332 335 336 osg::Vec3 top = origin + yAxis*height; 337 333 338 osg::Vec3d screenCenter = origin + widthVector*0.5f + heightVector*0.5f; 334 339 float screenRadius = heightVector.length() * 0.5f; 335 340 341 double rotation = osg::DegreesToRadians(rotationDegrees); 342 336 343 osg::Vec3 cursor = bottom; 337 344 int i,j; 338 345 339 346 int midSteps = noSteps/2; 347 348 bool flip = false; 349 if (arguments.read("--flip")) { flip = true; } 340 350 341 351 for(i=0;i<midSteps;++i) … … 347 357 double theta = atan2(delta.x(), -delta.y()); 348 358 theta += 2*osg::PI; 359 349 360 double phi = osg::PI_2 * delta.length() / screenRadius; 350 361 if (phi > osg::PI_2) phi = osg::PI_2; … … 360 371 // osg::notify(osg::NOTICE)<<"cursor = "<<cursor<< " theta = "<<theta<< "phi="<<phi<<" gamma = "<<gamma<<" texcoord="<<texcoord<<std::endl; 361 372 362 vertices->push_back(cursor); 373 if (flip) 374 vertices->push_back(osg::Vec3(cursor.x(), top.y()-(cursor.y()-origin.y()),cursor.z())); 375 else 376 vertices->push_back(cursor); 377 363 378 colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); 364 379 texcoords->push_back(texcoord); … … 384 399 // osg::notify(osg::NOTICE)<<"cursor = "<<cursor<< " theta = "<<theta<< "phi="<<phi<<" gamma = "<<gamma<<" texcoord="<<texcoord<<std::endl; 385 400 386 vertices->push_back(cursor); 401 if (flip) 402 vertices->push_back(osg::Vec3(cursor.x(), top.y()-(cursor.y()-origin.y()),cursor.z())); 403 else 404 vertices->push_back(cursor); 405 387 406 colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); 388 407 texcoords->push_back(texcoord); … … 414 433 // osg::notify(osg::NOTICE)<<"cursor = "<<cursor<< " theta = "<<theta<< "phi="<<phi<<" gamma = "<<gamma<<" texcoord="<<texcoord<<std::endl; 415 434 416 vertices->push_back(cursor); 435 if (flip) 436 vertices->push_back(osg::Vec3(cursor.x(), top.y()-(cursor.y()-origin.y()),cursor.z())); 437 else 438 vertices->push_back(cursor); 439 417 440 colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); 418 441 texcoords->push_back(texcoord); … … 459 482 } 460 483 484 unsigned int screenNum = 0; 485 while (arguments.read("--screen",screenNum)) {} 486 487 461 488 unsigned int width, height; 462 wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier( 0), width, height);489 wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(screenNum), width, height); 463 490 464 491 while (arguments.read("--width",width)) {} … … 466 493 467 494 osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits; 495 traits->screenNum = screenNum; 468 496 traits->x = 0; 469 497 traits->y = 0;
