Advertisement
Guest User

initializeScene

a guest
Jan 23rd, 2014
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. __global__
  2. void initializeScene()
  3. {  
  4.     dev_cam = new Camera;
  5.     dev_cam->yaw = 0;
  6.     dev_cam->pitch = 0;
  7.     dev_cam->roll = 0;
  8.     dev_cam->fov = 90;
  9.     dev_cam->aspect = 4.0 / 3.0;
  10.     dev_cam->pos = Vector(0, 120, -100);
  11.     dev_cam->beginFrame();
  12.  
  13.     m_controller = new CameraController(*dev_cam, 0.05f);
  14.    
  15.     lightPos = Vector(0, 296, 100);
  16.     lightColor = Color(1, 1, 1);
  17.     lightPower = 60000;
  18.     ambientLight = Color(0.2, 0.2, 0.2);
  19.  
  20.  
  21.     // For Real Time Rendering
  22.     createNode(new Plane(5), new OrenNayar(Color(0.5, 0.5, 0.5), 1.0));
  23.  
  24.     createNode(new Plane(500), new OrenNayar(Color(0.5, 0.5, 0.5), 1.0));
  25.  
  26.     createNode(new Sphere(Vector(0, 50, 200), 40.0), new Phong(Color(0, 0, 1), 32));
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement