Click here to Skip to main content
15,892,965 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Is ++i statement in the for loop better than i++? Pin
valikac10-May-03 5:43
valikac10-May-03 5:43 
AnswerRe: Is ++i statement in the for loop better than i++? Pin
Michael Dunn10-May-03 7:09
sitebuilderMichael Dunn10-May-03 7:09 
GeneralRe: Is ++i statement in the for loop better than i++? Pin
S van Leent10-May-03 11:14
S van Leent10-May-03 11:14 
GeneralRe: Is ++i statement in the for loop better than i++? Pin
Joe Woodbury10-May-03 11:47
professionalJoe Woodbury10-May-03 11:47 
GeneralDLLs Pin
Dominik Reichl9-May-03 22:23
Dominik Reichl9-May-03 22:23 
GeneralRe: DLLs Pin
Rickard Andersson2010-May-03 3:26
Rickard Andersson2010-May-03 3:26 
GeneralGDI+ Pin
sharlila9-May-03 21:43
sharlila9-May-03 21:43 
Generalit don't draw Pin
aguest9-May-03 19:53
aguest9-May-03 19:53 
GeneralRe: it don't draw Pin
Bartosz Bien9-May-03 21:48
Bartosz Bien9-May-03 21:48 
GeneralRe: it don't draw Pin
aguest10-May-03 6:01
aguest10-May-03 6:01 
GeneralRe: it don't draw Pin
Bartosz Bien10-May-03 14:20
Bartosz Bien10-May-03 14:20 
GeneralNeed a simple "console-style" output window in MFC Pin
Jan759-May-03 19:33
Jan759-May-03 19:33 
GeneralRe: Need a simple "console-style" output window in MFC Pin
S van Leent10-May-03 11:20
S van Leent10-May-03 11:20 
Generalquestion about socket Pin
wood9-May-03 18:15
wood9-May-03 18:15 
GeneralRe: question about socket Pin
Ernest Laurentin9-May-03 19:16
Ernest Laurentin9-May-03 19:16 
GeneralWhat does the getpeename return? Pin
wood10-May-03 21:47
wood10-May-03 21:47 
GeneralRe: question about socket Pin
valikac10-May-03 5:53
valikac10-May-03 5:53 
GeneralCan you tell me what does the getnameinfo() return? Pin
wood10-May-03 22:03
wood10-May-03 22:03 
GeneralCreate edit control inside thread Pin
Nena19769-May-03 17:01
Nena19769-May-03 17:01 
GeneralRe: Create edit control inside thread Pin
valikac10-May-03 5:55
valikac10-May-03 5:55 
Generalcall fuction from another class Pin
aguest9-May-03 13:18
aguest9-May-03 13:18 
GeneralRe: call fuction from another class Pin
Wes Aday9-May-03 13:45
professionalWes Aday9-May-03 13:45 
GeneralRe: call fuction from another class Pin
aguest9-May-03 14:07
aguest9-May-03 14:07 
GeneralRe: call fuction from another class Pin
Toni789-May-03 14:15
Toni789-May-03 14:15 
GeneralRe: call fuction from another class Pin
aguest9-May-03 15:29
aguest9-May-03 15:29 
// creatfoufou.cpp: implementation of the creatfoufou class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "OpenGl.h"
#include "creatfoufou.h"
#include "foufou.h"

#include

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

creatfoufou::creatfoufou()
{

}

creatfoufou::~creatfoufou()
{

}

void creatfoufou::creatfou(int amount)
{
foufou *newfoufouPtr;
int randomX,randomY,randomZ;
int speed,steer;

for(int index=0;index {
newfoufouPtr = new foufou();
fou_caracter.push_back( newfoufouPtr );
//ici vien l'integration ou le dessin de foufou dans la scene
randomX = ( ( 1 + rand( ) % 900 ) - 450 );
randomY = ( ( 1 + rand( ) % 100 ) - 50 );
randomZ = ( ( 1 + rand( ) % 900 ) - 450 );

setposition(randomX,randomY,randomZ);
//speed =

//steer =

//lui attribue sa vitesse
//lui attribuer son emplacement
//lui attribuer sa direction

}
}

void creatfoufou::setposition(int newX, int newY, int newZ)
{
-->the mistak RePaint(randomX,randomY,randomZ);
}


and here when i declared
// foufou.cpp: implementation of the foufou class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "OpenGl.h"
#include "foufou.h"
#include

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

foufou::foufou()
{

}

foufou::~foufou()
{

}



//Propriétés réflectives de l'objet touché par la lumière
GLfloat Material_Ambiante[]={0.5,0.5, 0.5, 1 };
GLfloat Material_Difuse[]={0.5, 0.5, 0.5, 1};
GLfloat Material_Specular[]={0.5, 0.5, 0.5, 1};



//Propriété de la lumière

GLfloat Light_Ambiante[]={0.2, 0.2, 0.2, 0.1};
GLfloat Light_Difuse[]={0.5, 0.5, 0.5, 1.0 };
GLfloat Light_Specular[]={1.0, 1.0, 1.1, 1.0 };
GLfloat Light_Position[]={10, 12, 10, 1.0 };



GLfloat Light_Direction[]={0.0,-1.0, 0.0, 1.0};








void foufou::Initial()
{
//Définir les propriété de l'objet touché par la lumière ainsi que la lumière

glMaterialfv( GL_FRONT, GL_AMBIENT, Material_Ambiante);
glMaterialfv( GL_FRONT, GL_DIFFUSE, Material_Difuse);
glMaterialfv( GL_FRONT, GL_SPECULAR,Material_Specular);
glMaterialf( GL_FRONT, GL_SHININESS, 20);

glLightfv( GL_LIGHT0, GL_AMBIENT,Light_Ambiante );
glLightfv( GL_LIGHT0, GL_DIFFUSE, Light_Difuse );
glLightfv( GL_LIGHT0, GL_SPECULAR, Light_Specular);
glLightfv( GL_LIGHT0, GL_POSITION, Light_Position );




//Activation de l'éclairage
glEnable( GL_LIGHTING );


//Activation de la première lumière
glEnable( GL_LIGHT0 );



//Activation du test de profondeur
glEnable( GL_DEPTH_TEST );

};

void foufou::RePaint(int xpos,int ypos,int zpos)
{
//Vidage du contenu situé à l'écran
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//glClearColor(0.3, 0.3, 0.3, 1.0);


//On réénitialise la matrice modélisation-visualisation
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();


//On place la caméra dans la scène

gluPerspective (90, 1, 5, 50);
gluLookAt (2,2, -15, -4,0.0, 1, 0.0, 1.0, 0.0 );


//surface avec rotation de 45°
glPushMatrix();


//rotation de la surface
// glTranslated(0.0, 30.0, 15.0 );
// glRotated( 15, 0.0, 0.0, 0.0 );

////////
//Proprité de réfléction ambiante de la matière
glColorMaterial( GL_FRONT, GL_AMBIENT );
glColor4f(0.5, 0.5, 0.6, 1.0 );
//Proprité de réfléction diffuse de la matière}
glColorMaterial( GL_FRONT, GL_DIFFUSE );
glColor4f( 0.5, 0.2, 0.8, 1.0 );
//Proprité de réfléction speculaire de la matière}
glColorMaterial( GL_FRONT, GL_SPECULAR );
glColor4f( 0.9, 0.8, 1.0, 1.0 );
//Création de la surface 30 x 30}


//glutSolidCube(3);

glTranslated(-xpos, ypos, zpos );
glutSolidSphere(0.9,30,40);
glDisable( GL_LIGHTING );

glPopMatrix();




//glDisable(GL_TEXTURE_2D);

SwapBuffers(wglGetCurrentDC());

};


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.