Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <cstdlib>
  4. #include <vector>
  5. #include "phage.h"
  6. using namespace std;
  7.  
  8.  
  9. float phage::lieuDeNaissance(float P_min,float P_max){
  10.     P_x = ((P_max-P_min)*((float)rand()/RAND_MAX))+P_min;
  11.     P_y = ((P_max-P_min)*((float)rand()/RAND_MAX))+P_min;
  12.     P_z = ((P_max-P_min)*((float)rand()/RAND_MAX))+P_min;
  13.  
  14. }
  15.  
  16. float phage::affiche(){
  17.  
  18. phage();
  19.  
  20.     phage::lieuDeNaissance(0.0,30.0);
  21.  
  22.     //glTranslatef(0.0f, 0.0f, -100.0f);
  23.  
  24.     glPushMatrix();
  25.         glColor3f(5.0, 34.0, 1.0);
  26.         glTranslated(P_x,P_y,P_z);
  27.         glutSolidSphere(5.0, 60,60);
  28.     glPopMatrix();
  29.  
  30.  
  31.     cout<<"x : "<<P_x<<endl<<"y : "<<P_y<<endl<<"z : "<<P_z<<endl;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement