Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <cstdlib>
- #include <vector>
- #include "phage.h"
- using namespace std;
- float phage::lieuDeNaissance(float P_min,float P_max){
- P_x = ((P_max-P_min)*((float)rand()/RAND_MAX))+P_min;
- P_y = ((P_max-P_min)*((float)rand()/RAND_MAX))+P_min;
- P_z = ((P_max-P_min)*((float)rand()/RAND_MAX))+P_min;
- }
- float phage::affiche(){
- phage();
- phage::lieuDeNaissance(0.0,30.0);
- //glTranslatef(0.0f, 0.0f, -100.0f);
- glPushMatrix();
- glColor3f(5.0, 34.0, 1.0);
- glTranslated(P_x,P_y,P_z);
- glutSolidSphere(5.0, 60,60);
- glPopMatrix();
- cout<<"x : "<<P_x<<endl<<"y : "<<P_y<<endl<<"z : "<<P_z<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement