Entradas

Avatar Israel González de la Peña

Imagen
#include <windows.h> #include <GL/glut.h> #include <stdlib.h> #include <stdio.h> #include <math.h> float angulo=0; void display(void) {     glClear( GL_COLOR_BUFFER_BIT );     glColor3f(0.0, 0.0, 0.0);     glPushMatrix();     glRotatef(angulo+2, 0, 1, 0);     //Cabeza     glPushMatrix();     glTranslatef(0,2,0);     glRotatef(90,1,0,0);     glScalef(1.5,0.7,1);     glutWireSphere(0.6,30,30);     glPopMatrix();     //Cuerpo     glPushMatrix();     glTranslatef(0,1,0);     glRotatef(90,1,0,0);     glScalef(1.5,0.7,1);     glutWireTorus(0.5,0.5,30,30);     glPopMatrix();     //Cuerpo     glPushMatrix();     glTranslatef(0,0,0);     glRotatef(90,1,0,0);     glScalef(1.5,0.7,1);     glutWire...

Tarea Humanoide | Diana Vargas

Imagen
#include <windows.h> #include <GL/glut.h> #include <stdlib.h> #include <stdio.h> #include <math.h> float angulo=0; void display(void) {     glClear( GL_COLOR_BUFFER_BIT );     glColor3f(0.0, 0.0, 0.0);     glPushMatrix();     glRotatef(angulo+2, 0, 1, 0);     //HEAD     glPushMatrix();     glTranslatef(0,1.8,0);     glScalef(1.5,0.7,1);     glutWireSphere(1,20,20);     glPopMatrix();     //BODY     glPushMatrix();     glTranslatef(0,-1.2,0);     glScalef(2,1.5,1.5);     glutWireSphere(1,20,20);     glPopMatrix();     glPushMatrix();     glTranslatef(0,0.5,0);     glScalef(1.6,0.6,1);     glutWireSphere(1,20,20);     glPopMatrix();     // PIE DER     glPushMatrix();     glTranslatef(0....

Tarea Texturas | Diana Vargas

Imagen
//Diana #include <windows.h> #include<stdio.h> #include<stdlib.h> //#include <GLUT/GLUT.h> #include <GL/glut.h> #include <math.h> int ancho=128,alto=128; float rotar=0,inc=0.1,rotar1=0; unsigned char * datos; unsigned char * datos1; void leerImagen(){     FILE *imagen;     imagen=fopen("C:\\Users\\hp\\Documents\\7 SEMESTRE\\spiderweb.raw","r");//abre el arch     if(imagen==NULL){printf("Error: No imagen");}     else{printf("Imagen cargada correctamente");}     datos=(unsigned char*)malloc(ancho*alto*3);//malloc : localidad de memoria     fread(datos,ancho*alto*3,1,imagen);     fclose(imagen);     } void usarTextura(){     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, ancho, alto, 0, ...

Código Menú|Animación // Diana Vargas B

Imagen
#include <windows.h> #include <stdlib.h> #include <stdio.h> #include <math.h> #include <GL/glut.h> float rotar = 0,inc=0.1, ry=0, rx=0,ang=0,botar=1, relleno=1;// botar =una bandera float r=1,g=0,b=0; int figurita =1; float x,y; float radio=0; float cx=0; float cy=0; float dx, dy; void dibujaCuadro(void) {     if(relleno==1){     glColor3f(r, g, b);     glBegin(GL_QUADS);     glVertex2f(5, 5);     glVertex2f(-5, 5);     glVertex2f(-5, -5);     glVertex2f(5, -5);     glEnd();     }else{     glColor3f(r, g, b);     glBegin(GL_LINE_LOOP);     glVertex2f(5, 5);     glVertex2f(-5, 5);     glVertex2f(-5, -5);     glVertex2f(5, -5);     glEnd();     } } //CAP AMERICA void estrella(float r, float g, float b){     if(relleno==1){     glColor3f...

Código Menú|Animación Israel

#include <windows.h> #include <stdlib.h> #include <stdio.h> #include <math.h> #include <GL/glut.h> #define PI 3.141592653 float rotar = 0,inc=0.1, ry=0, rx=0, ang=0,botar=1; float r=1,g=0,b=0; int figura=0; float r1=40, r2=25, r3=60, r4=30, r5=18, dx, dy; void dibujaCuadro(void) {     glColor3f(r, g, b);     glBegin(GL_QUADS);     glVertex2f(5, 5);     glVertex2f(-5, 5);     glVertex2f(-5, -5);     glVertex2f(5, -5);     glEnd(); } void circulo1 (void){     glColor3f(0,0,0);     glBegin(GL_POLYGON);     for(float i=0.0; i<2*PI; i+=0.01){         dx=r1*cos(i);         dy=r1*sin(i)-75;         glVertex2f(dx, dy);         }     glEnd(); } void circulo2 (void){     glColor3f(0,0,0);     glBegin(GL_POLYGON); ...