rrk275
Messages postés540Date d'inscriptionvendredi 25 juin 2004StatutMembreDernière intervention 1 octobre 2007
-
26 août 2006 à 00:37
rrk275
Messages postés540Date d'inscriptionvendredi 25 juin 2004StatutMembreDernière intervention 1 octobre 2007
-
25 oct. 2006 à 07:39
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.
Chubab
Messages postés11Date d'inscriptionmardi 6 décembre 2005StatutMembreDernière intervention19 mai 2009 30 août 2006 à 15:23
je sait que les headers sont dans le haut du main, mais justement comment est-ce que je fais pour installer la SDL?
Merci encore,
CHUBAB
rrk275
Messages postés540Date d'inscriptionvendredi 25 juin 2004StatutMembreDernière intervention 1 octobre 20072 30 août 2006 à 12:41
Je me suis amusé a rajouter une dimension temporelle .. ca dechire graphiquement même si mathematiquement ca ne sert pas a grand chose ^^ ( ca fait une espece de vaguelette .. )
cs_BCedric
Messages postés17Date d'inscriptionlundi 31 juillet 2006StatutMembreDernière intervention13 mai 2014 30 août 2006 à 10:52
Les headers sont en haut dans le main et pour pouvoir compiler, il faut installer la SDL et la linker.
Il faut aussi rajouter glu32 et opengl32 (dans le linker).
Chubab
Messages postés11Date d'inscriptionmardi 6 décembre 2005StatutMembreDernière intervention19 mai 2009 30 août 2006 à 03:54
ceci semble tres interessant, mais je me demandais comment est-ce qu'on compile le fichier main.c?...
où sont les fichiers .h inclus dans le prog?
Merci,
CHUBAB
cs_BCedric
Messages postés17Date d'inscriptionlundi 31 juillet 2006StatutMembreDernière intervention13 mai 2014 27 août 2006 à 21:03
Merci :)
rrk275
Messages postés540Date d'inscriptionvendredi 25 juin 2004StatutMembreDernière intervention 1 octobre 20072 26 août 2006 à 00:43
z[x+20][y+20]=cos(sqrt(x*x+y*y));
for fun ^^
rrk275
Messages postés540Date d'inscriptionvendredi 25 juin 2004StatutMembreDernière intervention 1 octobre 20072 26 août 2006 à 00:37
J'adore , encore plus quand c'est dessiné ainsi
glBegin(GL_QUADS);
{
for ( x=1; x<40; x++ )
{
for ( y=1; y<40; y++ )
{
glColor3ub(-y*6, x*6, y*6);
25 oct. 2006 à 07:39
Louis
25 oct. 2006 à 03:26
Un conseil : ajoutez des points et modifiez le système de couleur
/***************************************************************************************/
#define AMPLITUDE 255
[...]
float max=-1, min=1;
float z[AMPLITUDE+1][AMPLITUDE+1]={{0}};
for ( x=-AMPLITUDE/2; x<1+AMPLITUDE/2; x++ )
for ( y=-AMPLITUDE/2; y<1+AMPLITUDE/2; y++ )
{
/*
* Equation
*************************/
z[x+AMPLITUDE/2][y+AMPLITUDE/2]=y*atan((double)y/x);
max = z[x+AMPLITUDE/2][y+AMPLITUDE/2]>max ? z[x+AMPLITUDE/2][y+AMPLITUDE/2] : max;
min = z[x+AMPLITUDE/2][y+AMPLITUDE/2]<min ? z[x+AMPLITUDE/2][y+AMPLITUDE/2] : min;
[...]
glBegin(GL_QUADS);
{
for ( x=1; x<AMPLITUDE; x++ )
{
for ( y=1; y<AMPLITUDE; y++ )
{
glColor3ub((z[x][y]-min)*256/(max-min), x*256/AMPLITUDE, y*256/AMPLITUDE);
glVertex3d(x-AMPLITUDE/2, y-AMPLITUDE/2, z[x][y]);
glVertex3d(x-AMPLITUDE/2, y-AMPLITUDE/2+1, z[x][y+1]);
glVertex3d(x-AMPLITUDE/2+1, y-AMPLITUDE/2+1, z[x+1][y+1]);
glVertex3d(x-AMPLITUDE/2+1, y-AMPLITUDE/2, z[x+1][y]);
}
}
glEnd();
/***************************************************************************************/
Admirez le résultat ;)
1 sept. 2006 à 15:43
CHUBAB!
31 août 2006 à 11:33
Tres bon site de C et OpenGl ;)
30 août 2006 à 15:23
Merci encore,
CHUBAB
30 août 2006 à 12:41
30 août 2006 à 10:52
Il faut aussi rajouter glu32 et opengl32 (dans le linker).
30 août 2006 à 03:54
où sont les fichiers .h inclus dans le prog?
Merci,
CHUBAB
27 août 2006 à 21:03
26 août 2006 à 00:43
for fun ^^
26 août 2006 à 00:37
glBegin(GL_QUADS);
{
for ( x=1; x<40; x++ )
{
for ( y=1; y<40; y++ )
{
glColor3ub(-y*6, x*6, y*6);
glVertex3d(x-20, y-20, z[x][y]);
glVertex3d(x-20, y-19, z[x][y+1]);
glVertex3d(x-19, y-19, z[x+1][y+1]);
glVertex3d(x-19, y-20, z[x+1][y]);
}
}
glEnd();
(juste apres le repere(); .. )