Click here to Skip to main content
15,889,595 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: call fuction from another class Pin
Toni789-May-03 15:46
Toni789-May-03 15:46 
GeneralRe: call fuction from another class Pin
aguest9-May-03 18:19
aguest9-May-03 18:19 
GeneralRe: call fuction from another class Pin
Toni789-May-03 18:32
Toni789-May-03 18:32 
GeneralDepricating functions Pin
Jack Handy9-May-03 9:26
Jack Handy9-May-03 9:26 
GeneralRe: Depricating functions Pin
Tim Smith9-May-03 9:34
Tim Smith9-May-03 9:34 
GeneralRe: Depricating functions Pin
Jack Handy9-May-03 9:46
Jack Handy9-May-03 9:46 
GeneralRe: Depricating functions Pin
Tim Smith9-May-03 9:49
Tim Smith9-May-03 9:49 
GeneralRe: Depricating functions Pin
aguest9-May-03 15:16
aguest9-May-03 15:16 
// creatfoufou.cpp: implementation of the creatfoufou class.<br />
//<br />
//////////////////////////////////////////////////////////////////////<br />
<br />
#include "stdafx.h"<br />
#include "OpenGl.h"<br />
#include "creatfoufou.h"<br />
#include "foufou.h"<br />
<br />
#include <math.h><br />
<br />
#ifdef _DEBUG<br />
#undef THIS_FILE<br />
static char THIS_FILE[]=__FILE__;<br />
#define new DEBUG_NEW<br />
#endif<br />
<br />
//////////////////////////////////////////////////////////////////////<br />
// Construction/Destruction<br />
//////////////////////////////////////////////////////////////////////<br />
<br />
creatfoufou::creatfoufou()<br />
{<br />
<br />
}<br />
<br />
creatfoufou::~creatfoufou()<br />
{<br />
<br />
}<br />
<br />
void creatfoufou::creatfou(int amount)<br />
{<br />
   foufou *newfoufouPtr;<br />
   int randomX,randomY,randomZ;<br />
   int speed,steer;<br />
<br />
   for(int index=0;index<amount;index++)<br />
   {<br />
	   newfoufouPtr = new foufou();<br />
       fou_caracter.push_back( newfoufouPtr );<br />
//ici vien l'integration ou le dessin de foufou dans la scene<br />
	   	randomX = ( ( 1 + rand( ) % 900 ) - 450 );<br />
		randomY = ( ( 1 + rand( ) % 100 ) - 50 );<br />
		randomZ = ( ( 1 + rand( ) % 900 ) - 450 );<br />
   <br />
		setposition(randomX,randomY,randomZ);<br />
	   //speed =<br />
<br />
	   //steer =<br />
<br />
	   //lui attribue sa vitesse<br />
	   //lui attribuer son emplacement<br />
       //lui attribuer sa direction<br />
<br />
   }<br />
}<br />
<br />
void creatfoufou::setposition(int newX, int newY, int newZ)<br />
{<br />
-->the mistak	RePaint(randomX,randomY,randomZ);<br />
}<br />


and here when i declared
// foufou.cpp: implementation of the foufou class.<br />
//<br />
//////////////////////////////////////////////////////////////////////<br />
<br />
#include "stdafx.h"<br />
#include "OpenGl.h"<br />
#include "foufou.h"<br />
#include <gl/glut.h><br />
<br />
#ifdef _DEBUG<br />
#undef THIS_FILE<br />
static char THIS_FILE[]=__FILE__;<br />
#define new DEBUG_NEW<br />
#endif<br />
<br />
//////////////////////////////////////////////////////////////////////<br />
// Construction/Destruction<br />
//////////////////////////////////////////////////////////////////////<br />
<br />
foufou::foufou()<br />
{<br />
<br />
}<br />
<br />
foufou::~foufou()<br />
{<br />
<br />
}<br />
<br />
<br />
<br />
//Propriétés réflectives de l'objet touché par la lumière<br />
GLfloat Material_Ambiante[]={0.5,0.5, 0.5, 1 };<br />
GLfloat Material_Difuse[]={0.5, 0.5, 0.5, 1};<br />
GLfloat Material_Specular[]={0.5, 0.5, 0.5, 1};<br />
<br />
<br />
<br />
//Propriété de la lumière<br />
<br />
GLfloat Light_Ambiante[]={0.2, 0.2, 0.2, 0.1};<br />
GLfloat Light_Difuse[]={0.5, 0.5, 0.5, 1.0 };<br />
GLfloat Light_Specular[]={1.0, 1.0, 1.1, 1.0 };<br />
GLfloat Light_Position[]={10, 12, 10, 1.0  };<br />
<br />
<br />
<br />
GLfloat Light_Direction[]={0.0,-1.0, 0.0, 1.0};<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
void foufou::Initial()<br />
{<br />
//Définir les propriété de l'objet touché par la lumière ainsi que la lumière<br />
<br />
	glMaterialfv( GL_FRONT, GL_AMBIENT, Material_Ambiante);<br />
    glMaterialfv( GL_FRONT, GL_DIFFUSE, Material_Difuse);<br />
    glMaterialfv( GL_FRONT, GL_SPECULAR,Material_Specular);<br />
    glMaterialf( GL_FRONT, GL_SHININESS, 20);<br />
<br />
    glLightfv( GL_LIGHT0, GL_AMBIENT,Light_Ambiante );<br />
    glLightfv( GL_LIGHT0, GL_DIFFUSE, Light_Difuse );<br />
    glLightfv( GL_LIGHT0, GL_SPECULAR, Light_Specular);<br />
    glLightfv( GL_LIGHT0, GL_POSITION, Light_Position );<br />
<br />
<br />
<br />
<br />
//Activation de l'éclairage<br />
	glEnable( GL_LIGHTING );<br />
<br />
<br />
//Activation de la première lumière<br />
	glEnable( GL_LIGHT0 );<br />
<br />
<br />
<br />
//Activation du test de profondeur<br />
	glEnable( GL_DEPTH_TEST );<br />
<br />
};<br />
<br />
void foufou::RePaint(int xpos,int ypos,int zpos)<br />
{<br />
//Vidage du contenu situé à l'écran<br />
	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);<br />
	//glClearColor(0.3, 0.3, 0.3, 1.0);<br />
<br />
		<br />
//On réénitialise la matrice modélisation-visualisation<br />
	glMatrixMode (GL_PROJECTION);<br />
	glLoadIdentity ();<br />
<br />
<br />
//On place la caméra dans la scène<br />
<br />
gluPerspective (90, 1, 5, 50);<br />
gluLookAt (2,2, -15,  -4,0.0, 1,   0.0, 1.0, 0.0 );<br />
<br />
<br />
//surface avec rotation de 45°<br />
	glPushMatrix();<br />
<br />
<br />
	//rotation de la surface<br />
//	glTranslated(0.0, 30.0, 15.0 );<br />
  // glRotated( 15, 0.0, 0.0, 0.0 );<br />
	<br />
	////////<br />
	//Proprité de réfléction ambiante de la matière<br />
         glColorMaterial( GL_FRONT, GL_AMBIENT );<br />
         glColor4f(0.5, 0.5, 0.6, 1.0 );<br />
         //Proprité de réfléction diffuse de la matière}<br />
         glColorMaterial( GL_FRONT, GL_DIFFUSE );<br />
         glColor4f( 0.5, 0.2, 0.8, 1.0 );<br />
         //Proprité de réfléction speculaire de la matière}<br />
         glColorMaterial( GL_FRONT, GL_SPECULAR );<br />
         glColor4f( 0.9, 0.8, 1.0, 1.0 );<br />
         //Création de la surface 30 x 30}<br />
	<br />
		  <br />
         	//glutSolidCube(3);<br />
	<br />
			glTranslated(-xpos, ypos, zpos );<br />
      glutSolidSphere(0.9,30,40);<br />
	  	glDisable( GL_LIGHTING );<br />
<br />
    glPopMatrix();<br />
<br />
<br />
<br />
 <br />
//glDisable(GL_TEXTURE_2D);<br />
<br />
	SwapBuffers(wglGetCurrentDC());<br />
	<br />
};<br />

GeneralRe: Depricating functions Pin
Jack Handy9-May-03 22:07
Jack Handy9-May-03 22:07 
Generalnamespaces and forward declarations Pin
Member 9076299-May-03 8:58
Member 9076299-May-03 8:58 
GeneralRe: namespaces and forward declarations Pin
Orhun Birsoy9-May-03 9:46
Orhun Birsoy9-May-03 9:46 
QuestionIs it possible to import a set of menus? Pin
adonisv9-May-03 8:54
adonisv9-May-03 8:54 
AnswerRe: Is it possible to import a set of menus? Pin
basementman9-May-03 9:01
basementman9-May-03 9:01 
GeneralCool, you can drag and drop even!!! Pin
adonisv9-May-03 9:20
adonisv9-May-03 9:20 
GeneralRead form serial port Pin
K. Shaffer9-May-03 8:46
K. Shaffer9-May-03 8:46 
GeneralRe: Read form serial port Pin
valikac9-May-03 9:34
valikac9-May-03 9:34 
GeneralRe: Read form serial port Pin
K. Shaffer9-May-03 10:18
K. Shaffer9-May-03 10:18 
GeneralRe: Read form serial port Pin
Toni789-May-03 14:36
Toni789-May-03 14:36 
GeneralRe: Read form serial port Pin
daima_8879-May-03 14:57
daima_8879-May-03 14:57 
GeneralRe: Read form serial port Pin
Jan759-May-03 19:24
Jan759-May-03 19:24 
GeneralDialog screen freezes Pin
yashraj9-May-03 8:22
yashraj9-May-03 8:22 
GeneralRe: Dialog screen freezes Pin
David Crow9-May-03 8:49
David Crow9-May-03 8:49 
GeneralRe: Dialog screen freezes Pin
Mahesh Varma9-May-03 18:11
Mahesh Varma9-May-03 18:11 
QuestionCalling a pure "C" function from a class: How? Pin
Cesario Simoes, jr9-May-03 8:14
Cesario Simoes, jr9-May-03 8:14 
AnswerRe: Calling a pure "C" function from a class: How? Pin
David Crow9-May-03 8:24
David Crow9-May-03 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.