Monday, April 16, 2007

Do You Capitalize Existentialism



# include # include stdio.h string.h
# include GL / glut.h
# include GL / gl.h

windows.h # include # include # include math.h

# include malloc.h stdarg.h
/ * Windows parameters * / # define

# define WIDTH 600 HEIGHT 600
# define TITLE "GLUT Demo: Using Subwindows"
void conv (void);
onMouse void (int button, int state, int x, int y);
hand void (void);
void Humanoide(void);
void Movimiento(void);
void onMouse2(int button, int state, int x, int y);
void onMotion2(int x, int y) ;
void onMotion(int x, int y);
void idle2(void);
int winIdMain;
int winIdSub;
int xo,im,yo,alpha,beta,ven,ven2,inif,aux;
int winIdSub2;
float xf,yf;
char xm[3]="000";
char ym[3]="000";
float r1,r2,r3,r4,r5,r6,rmu1,xmu,ymu,zmu,zp,xp;
float r7,r8,r9,r10,r11,r12,r13,r14,r15;
float x,y,z,brazod, brazoi, pied, piei;
int k=0;
xf=150;
yf=200;
ven=0;
ven2=0;
INIF = 0;
void init (void) {

glClear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT);}

void text (GLuint x, GLuint and, GLfloat scale, char * format, char * format2) {/ / Function to write text
va_list args;
char buffer [255], * p;
GLfloat font_scale = 33.33f 119.05f +;
va_start (args, format);
vsprintf (buffer, format, args);
va_end (args);
glMatrixMode (GL_PROJECTION);
glPushMatrix ();
glLoadIdentity ();
gluOrtho2D (0, glutGet (GLUT_WINDOW_WIDTH), 0,
glutGet (GLUT_WINDOW_HEIGHT));
glMatrixMode (GL_MODELVIEW);
glPushMatrix ();
glLoadIdentity();
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
glTranslatef(x, y, 0.0);
glScalef(scale/font_scale, scale/font_scale, scale/font_scale);
//len = (int) strlen(format);
glutStrokeCharacter(GLUT_STROKE_ROMAN, 40);
for(p = buffer; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
glutStrokeCharacter(GLUT_STROKE_ROMAN, 44);
va_start(args, format2);
vsprintf(buffer, format2, args);
va_end(args);
//len = (int) strlen(format2);
for(p = buffer; * P, p + +)
glutStrokeCharacter (GLUT_STROKE_ROMAN, * p);
glutStrokeCharacter (GLUT_STROKE_ROMAN, 41);
glPopAttrib ();
glPopMatrix ();
glMatrixMode (GL_PROJECTION);
glPopMatrix ();
glMatrixMode (GL_MODELVIEW);

} void fractal (void) {/ / Function which calculates the fractal
int ran;
ran = rand ()% 4;
if (ran == 1) {
xf = (50 + xf) / 2;
f = (200 + f) / 2;

} if (ran == 2) {
xf = (250 + xf) / 2;
f = (200 + f) / 2;

} if (ran == 3) {
xf = (150 + xf) / 2;
f = (50 + f) / 2;
}}

void paint (void) {/ / Function
fractal painting int xe, ze,
float x2, y2;
glColor3f (1.0,1.0,0.0) glBegin
(GL_POINTS)
glVertex3f (50.0f, 200.0f, 0.0 f)
glVertex3f (250.0f, 200.0f, 0.0f);
glVertex3f (150.0f, 50.0f, 0.0f);
glEnd ();
if (K == 0) {glBegin
(GL_POINTS)
glVertex3f (xf, yf, 0);
glEnd ();
k = 1;}

fractal ();
glBegin (GL_POINTS)
glVertex3f (xf, yf, 0);
glEnd ();}

void Display (void) / / Function that shows the main panatalla

{/ * Clean drawing board * /
glutSetWindow (winIdMain)
/ / glLoadIdentity ();
paint ();
glFlush ();}

/ * Another display function, this one
Will Be Used to update the graphic subwindow * / void
subDisplay () {/ / function that displays content of the sub
/ * Clear subwindow * /
if (im == 1) {
glutSetWindow (winIdSub)
glutSetCursor (GLUT_CURSOR_CYCLE)
glutPositionWindow (20, 20);
glClearColor (0.0, 0.0, 1.0, 0.0 )
glClear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT)
itoa (x, xm, 10);
itoa (I, m, 10);
glColor3f (1.0,1., 0.0);
glutPassiveMotionFunc (onMotion2)
text (xo , (500-I), 20, xm, ym);
}
if(im==2){
glutSetWindow (winIdSub2);
glutSetCursor (GLUT_CURSOR_SPRAY);
glutPositionWindow (100, 100);
glClearColor (1.0, 0.0,0.0, 0.0);
glClear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT);
glColor3f(1.0,1.0,0.0);
glutMouseFunc(onMouse2);
glPushMatrix();
glScalef(0.2,.2,.2);
//glTranslatef(0,0,0.0f);
glPushMatrix();
glScalef(0.4,2.4,2.0);
glTranslatef(-21,2.75f,0.0f);
glRotatef(90,0,0,1);
mano( );
glPopMatrix();
glPushMatrix();
glScalef(0.4,2.4,2.0);
glTranslatef(21,2.75f,0.0f);
glRotatef(-90,0,0,1);
mano();
glPopMatrix();
Humanoide();
glPopMatrix();
glutSwapBuffers ();
}
}
/* Callback function for reshaping the main window */
void Reshape (int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, w, h, 0);
glMatrixMode(GL_MODELVIEW);
}
/* Callback function for reshaping the subwindow */
void subReshape (int w, int h)
{
glViewport (0, 0, w, h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluOrtho2D (0.0f, 1.0F, 0.0f, 1.0F);}

idle2 void (void) / / handles the subwindow
{
Movement ();
subDisplay ();}

void idle (void) / / main window handle {

glutSetWindow (winIdMain)
glutPostRedisplay ();
glutSetWindow (winIdSub)
glutPostRedisplay ();
glutSetWindow (winIdSub2)
glutPostRedisplay ();}

onMouse void (int button, int state , int x, int y) / / Function main window mouse

{if ((button == GLUT_LEFT_BUTTON) & (state == GLUT_DOWN)) {
if (ven2 == 1) {
ven2 = 0;
glutDestroyWindow (winIdSub2);
goto yy;
}
if(ven==0){
winIdSub = glutCreateSubWindow (winIdMain, 500,500, 500 , 500);
glutMouseFunc(onMouse);
im=1;
glutDisplayFunc (subDisplay);
ven=1;
xo=x;
yo=y;
}
else ven=1;
yy: aux=0;
}
if ( (button == GLUT_RIGHT_BUTTON) & (state == GLUT_DOWN) ) {
if(ven==1){
ven=0;
glutDestroyWindow(winIdSub);
goto xx;
}
if(ven2==0){
winIdSub2 = glutCreateSubWindow (winIdMain, 500,500, 500 , 500);
glutMouseFunc(onMouse2);
im=2;
glutDisplayFunc (subDisplay);
glutIdleFunc (idle2);
ven2=1;
xo=x;
yo=y;
}
else ven2=1;
}
xx: aux=1;
}
void onMouse2(int button, int state, int x, int y) //Funcion mouse subventana
{
if ( (button == GLUT_LEFT_BUTTON) & (state == GLUT_DOWN) ) {
if(ven2==1){
ven2=0;
glutSetWindow (winIdMain);
main();
glutDestroyWindow (winIdSub2);
goto yy;
}
if(ven==0){
winIdSub = glutCreateSubWindow (winIdMain, 500,500, 500 , 500);
glutMouseFunc(onMouse);
im=1;
glutDisplayFunc (SubDisplay) are
= 1;
xo = x;
yo = y;}

else seen = 1;
yy: aux = 0;

}} void
onMotion (int x, int y) {/ / mouse motion function main window
alpha = (alpha + (y - yo));
beta = (beta + (x - xo));
xo = x, I = y;
glutPostRedisplay ();}

onMotion2 void (int x, int y) {/ / Function subwindow mouse movement
alpha = (alpha + (y - yo));
beta = (beta + (x - xo));
xo = x; I = y;
glutPostRedisplay ();}

void keyboard (unsigned char key, int x, int y) / / keyboard event
{
switch (key) {
case 27:
exit(0);
break;
}
}
int main (int argc, char **argv)
{
/* Glut initializations */
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_SINGLE GLUT_RGBA GLUT_DEPTH);
glutInitWindowPosition (20,20);
glutInitWindowSize (WIDTH, HEIGHT);
/* Main window creation and setup */
winIdMain = glutCreateWindow (TITLE);
// glutSetWindow (winIdMain);
init ();
glutDisplayFunc (Display);
glutReshapeFunc (Reshape);
glutMouseFunc(onMouse);
glutPassiveMotionFunc(onMotion);
glutKeyboardFunc(keyboard);
glutIdleFunc (idle);
glutMainLoop ();
return 0;}

void Move (void) / / Random motion of humanoid

{x = rand ()% 2;
y = rand ()% 2;
z = rand ()% 2;
brazod = rand ()% 80;
brazoi = rand ()% 80;
pied = rand ()% 80;
PIEI = rand ()% 80;
/ / axis of rotation
wrist xmu = rand ()% 2;
YMU = rand ()% 2;
UMZ = rand ()% 2;
/ / angle of the wrist
RMU1 = rand ()% 90;
/ / angles of degrees of freedom of the middle finger
r1 = rand ()% 180;
r2 = rand ()% 180;
r3 = rand ()% 180;
/ / angles of degrees of freedom of the index finger
r4 = rand ()% 180;
r5 = rand ()% 180;
r6 = rand ()% 180;
/ / angles of degrees of freedom of finger
cancel r7 = rand ()% 180;
r8 = rand ()% 180;
r9 = rand ()% 180;
/ / angles of degrees of freedom of the little finger
r10 = rand ()% 180;
r11 = rand ()% 180;
r12 = rand ()% 180;
/ / angles of degrees of freedom of the thumb
r13 = rand ()% 180;
r14 = rand ()% 180;
r15 = rand ()% 180;
/ / axis of rotation of the thumb
zp = 1;
xp = 0;}

Humanoid void (void) / / Function of Humanoid

{glPushMatrix ();
/ / head
glTranslatef (0.0f, 2.5f, 0.0f);
glutWireCube (0.5);
/ / trunk
glScalef (2.5,2.5,2.0);
glTranslatef (0.0 f,-0.45f, 0.0f);
glutWireCube (0.5);
/ / legs
glPushMatrix ();
glPushMatrix ();
/ / left leg
glRotatef (PIEI, x, y, z);
glTranslatef ( -0.1f,-0.55f, 0.0f);
glScalef (-. 3,1.2,1.0)
glutWireCube (0.5);
glPushMatrix ();
glTranslatef (0.0f,-0.7f, 0.0f);
glutWireCube (0.5);
glPushMatrix ();
glTranslatef (0.0f, .35 f, 0.0f);
glScalef (1.1, .4,1.0)
glutWireCube (0.5);
glPopMatrix ();
glPopMatrix ();
/ / feet
glPushMatrix ();
glTranslatef (.3 f,-1.0f, 0.0f);
glScalef (1.6, .2,1.0)
glutWireCube (0.5);
glPopMatrix ();
glPopMatrix ();
/ / right leg
glRotatef (pied, x, y, z);
glTranslatef (0.1f,-0.55f, 0.0f);
glScalef ( -. 3,1.2,1.0)
glutWireCube (0.5);
glPushMatrix ();
glTranslatef (0.0f,-0.7f, 0.0f);
glutWireCube (0.5);
glPushMatrix ();
glTranslatef (0.0f , .35 f, 0.0f);
glScalef (1.1, .4,1.0)
glutWireCube (0.5);
glPopMatrix ();
glPopMatrix ();
/ / feet
glTranslatef (-. 3f,-1.0f, 0.0f);
glScalef (1.6, .2,1.0)
glutWireCube (0.5);

glPopMatrix ();
/ /
right arm glPushMatrix ();
glRotatef (brazod, x, y, z);
glTranslatef (0.35f, 0.1f, 0.0f);
glScalef (0.5,0.4, .5);
glutWireCube (0.5);
glPushMatrix ();
glTranslatef (0.4f, 0.0f, 0.0f);
glScalef (0.5,1.2,1.0);
glutWireCube (0.5);
glPopMatrix ();
glTranslatef (0.7f, 0.0f, 0.0f) ;
glScalef (.7,1,1.0)
glutWireCube (0.5);
/ / left arm
glPopMatrix ();
glRotatef(brazoi,x,y,z);
glTranslatef(-0.35f,0.1f,0.0f);
glScalef(0.5,0.4,.5);
glutWireCube (0.5);
glPushMatrix();
glTranslatef(-0.4f,0.0f,0.0f);
glScalef(0.5,1.2,1.0);
glutWireCube (0.5);
glPopMatrix();
glTranslatef(-0.7f,0.0f,0.0f);
glScalef(.7,1,1.0);
glutWireCube (0.5);
glPopMatrix();

}
void mano(void) //Funcion de la mano
{
glRotatef(rmu1,xmu,ymu,zmu);
glPushMatrix();
glTranslatef(-0.1,0.0,0.0f);
glScalef(1.7,2.5,1.0);
glutWireCube (0.5);
glPopMatrix();
/ /
middle finger glPushMatrix ();
glTranslatef (0.0,0.9,0.0 f);
glRotatef (r1, 1,0,0);
glScalef (.3,1.2,1.0)
glutWireCube (0.5);
glTranslatef (0.0, .45,0.0 f);
glRotatef (r2, 1,0,0);
glScalef (1.0,0.7,1.0);
glutWireCube (0.5);
glTranslatef (0.0, f .47,0.0 )
glRotatef (r3, 1,0,0);
glScalef (1.0,0.7,1.0);
glutWireCube (0.5);
glPopMatrix ();
/ /
index finger glPushMatrix ();
glTranslatef (0.2, 0.0,0.0 f);
glTranslatef (0.0,0.9,0.0 f);
glRotatef (r4, 1,0,0);
glScalef (.3,1.2,1.0)
glutWireCube (0.5);
glTranslatef (0.0, .45,0.0 f);
glRotatef (r5, 1,0,0);
glScalef (1.0,0.7,1.0);
glutWireCube (0.5);
glTranslatef (0.0, .47,0.0 f);
glRotatef (r6, 1,0,0);
glScalef (1.0,0.7,1.0);
glutWireCube (0.5);
glPopMatrix ();
/ /
finger glPushMatrix ();
glTranslatef (-0.2,0.0,0.0 f);
glTranslatef (0.0,0.9,0.0 f);
glRotatef (r7, 1,0,0);
glScalef (.3,1.2,1.0)
glutWireCube (0.5 )
glTranslatef (0.0, .45,0.0 f);
glRotatef (r8, 1,0,0);
glScalef (1.0,0.7,1.0);
glutWireCube (0.5);
glTranslatef (0.0, .47,0.0 f);
glRotatef (r9, 1,0,0);
glScalef (1.0,0.7,1.0);
glutWireCube (0.5);
glPopMatrix ();
/ / dedo meñique
glPushMatrix ();
glTranslatef (-0.4,0.0,0.0 f);
glTranslatef (0.0,0.9,0.0 f);
glRotatef (r10, 1,0,0);
glScalef (.3,1.2,1.0) ;
glutWireCube (0.5);
glTranslatef (0.0, .45,0.0 f);
glRotatef (R11, 1,0,0);
glScalef (1.0,0.7,1.0);
glutWireCube (0.5);
glTranslatef ( 0.0, .47,0.0 f);
glRotatef (R12, 1,0,0);
glScalef (1.0,0.7,1.0);
glutWireCube (0.5);
glPopMatrix ();
/ / thumb
glPushMatrix ();
glTranslatef (0.45, -0.8,0.0 f);
glTranslatef (0.0,0.9,0.0 f);
glRotatef (r13, xp, 0, zp);
glScalef (.3 , 1.2,1.0);
glutWireCube (0.5);
glTranslatef (0.0, .45,0.0 f);
glRotatef (r14, 1,0,0);
glScalef (1.0,0.7,1.0);
glutWireCube (0.5 )
glTranslatef (0.0, .47,0.0 f);
glRotatef (r15, 1,0,0);
glScalef (1.0,0.7,1.0);
glutWireCube (0.5);
glPopMatrix ();}

Sunday, April 15, 2007

Opened Knee Vs Closed Knee Support

Practice 7 IMPLEMENTATION OF NURBS CURVES AND SURFACES WITH PRACTICE REPORT

The NURBS (Non-Uniform Rational B-Splines) are mathematical entities that define exactly one curve or surface from several points of control, not necessarily belonging to the path, and a weight associated with them .
The higher the complexity of the curve, the greater the number of control points to be specified, but in any case, the number of points earned will be less than that required using the traditional approach straight.


Nurbs Curves are an important tool for working in 3D. Can be a simple way to model a surface or an advanced control for animation, defined by control points that control the shape of the curve. It also contains other types of item as editable, which indicates the beginning or end of a segment, and lines connecting the control points on a curve.

curve geometry is defined by degree, control points, knots, and slide rule. Surface Nurbs


have the principles of NURBS curves and apply the same, however a difference between curves and surfaces is that the curves sometena one direction and the surface is bidirectional, these bidirectional has a source called normal, that determines the front or back of it.

basic B-spline functions
Let U = {u0, u1,. . . , Ul} be a nondecreasing sequence of real numbers, ie
ui ≤ ui +1, i = 0,. . . , L-1. The ui are called nodes and U vector of nodes. The i-th B-spline basic function of degree p (order p + 1), denoted by Ni, p (u), is defined recursively:
Note that the functions Ni, 0 (u), i = 0,. . . , M are functions bound, identically zero except in the half-open interval [ui, ui +1) (which can have zero length, then both nodes can be the same). In contrast, for p> 0 the function Ni, p (u) is a linear combination of two basic functions of degree (p-1). Of course, the computation of the basic functions required to specify the vector of nodes U and the degree p.
The derivative of a basic function is given by successive derivatives
times the expression (2) we obtain Nk i, p (u), the k-th derivative of Ni, p (u), as
2.2
The NURBS Surfaces more widely used in surface design processes in industry are NURBS surfaces. This is explained by its great advantages, which include capabilities for interactive design and its ability to accurately represent closed shapes such as conics and quadrics. Moreover, NURBS surfaces include B-spline surfaces as special cases. De
Indeed, many applications of CAD / CAM, virtual reality, visualization and animation using models based on NURBS surfaces and these surfaces are included in many of the most popular formats in the industry, such as IGES. Also many newer graphics standards such as PHIGS + and OpenGL NURBS surfaces include among its primitive graphics. NURBS9
A surface S (u, v) of degree (p, q) is a bivariate rational function of the form:
where {wij} i, j represent the scalar values \u200b\u200bof the weights associated with control points {Pij } i = 0 ,..., n, j = 0 ,..., m and vectors of nodes U and V defined.
2.3 Derivatives of NURBS surfaces
The derivatives a NURBS surface can be calculated from the derivatives of A (u, v) and w (u, v) (the numerator and the denominator of the expression (4) respectively) as those derived
which can be easily calculated From expression (3). The expression (5) also indicates that the derivatives of a NURBS surface are obtained recursively and its computation is possible by applying a distributed scheme.

Thursday, April 12, 2007

Pvc Potato Gun For Sale

6

/ / According to the numbering would be reporting this practice 5
/ / Program drawing lines, triangles, and tables, clean the window every 30 seconds

# include string.h # include GL / glut.h
# include windows.h # include stdarg.h


# # include stdio.h

include malloc.h
void paint (void);
int option;
float r, b, g;
float x1, y1, z1;
char string [] = "00:00:00";
x0 = 24;
option = 1;

void init (void) {

glClear (GL_COLOR_BUFFER_BIT);}


void paint (void) {int

xe, ze,
float x2, y2;

if (option == 1) {


if (r> = 1 b> = 1 g> = 1) {
r = 0;
b = 0;
g = 0;}


r = r + .1;
b = b + .2;
g = g + .3;
glColor3f (r, b, g);
x1 = rand ()% 500;
Y1 = rand ()% 500;
z1 = rand ()% 500;
glBegin (GL_LINES);
glVertex3f (x1, Y1, 0);
x1 = rand ()% 500 ;
Y1 = rand ()% 500;
z1 = rand ()% 500;
glVertex3f (x1, Y1, 0);
glEnd ();}


if (opcion == 3) {

if ( r> = 1 b> = 1 g> = 1) {
r = 0;
b = 0;
g = 0;

}
r = r + .3;
b = b + .1;
g = g + .2;
glColor3f (r, b, g);
Y1 = rand ()% 12;
z1 = rand ()% 12;
x2 = rand ()% 500;
Y2 = rand ()% 500;

glPushMatrix ();
glTranslatef (x2, Y2, 0 );
glScalef (z1, Y1, 0);

glBegin (GL_LINES);
glVertex3f (10,2,0);
glVertex3f (20,2,0);
glEnd ();

glBegin (GL_LINES) ;
glVertex3f (10,2,0);
glVertex3f (10,12,0);
glEnd ();

glBegin (GL_LINES);
glVertex3f (20,2,0);
glVertex3f (20.12, 0);
glEnd ();

glBegin (GL_LINES);
glVertex3f (10,12,0);
glVertex3f (20,12,0);
glEnd ();
glPopMatrix ();}


if (opcion == 2) {

if (r> = 1 b> = 1 g> = 1) {
r = 0;
b = 0;
g = 0;}


r = r + .2;
b = b + .3;
g = g + .1;
glColor3f (r, b, g);
x1 = rand ()% 15;
Y1 = rand ()% 15;
x2 = rand ()% 500;
Y2 = rand ()% 500;
glPushMatrix ();
glTranslatef (x2, Y2, 0);
glScalef (x1, Y1, 0);
glBegin (GL_LINES);
glVertex3f (-10,1,0);
glVertex3f (10,1,0);
glEnd ();

glBegin (GL_LINES);
glVertex3f (0,20,0);
glVertex3f (-10,1,0);
glEnd ();

glBegin (GL_LINES);
glVertex3f (0,20,0);
glVertex3f (10,1,0);
glEnd ();

glPopMatrix ();}



} void display (void) {

surface ();
glFlush ();}


void reshape (int w, int h) {

glViewport (0, 0, w , h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluOrtho2D (0, w, h, 0);
glMatrixMode (GL_MODELVIEW);}

/ / MANEJO DEL RETARDO
TimerFunction void () {

glutPostRedisplay ();
glutTimerFunc (3000, TimerFunction, 1);
}
void TimerFunction2()
{
glutPostRedisplay();
glClear(GL_COLOR_BUFFER_BIT);
glutTimerFunc(30000, TimerFunction2, 2);

}


//ACCIONES DEL MOUSE
void onMouse(int button, int state, int x, int y) {

if ( (button == GLUT_RIGHT_BUTTON) & (state == GLUT_DOWN) ) {
if(opcion==1)
opcion=1;
if(opcion==2)
opcion=1;
if(opcion==3)
opcion=2;
TimerFunction();
}

if ( (button == GLUT_LEFT_BUTTON) & (state == GLUT_DOWN) ) {
if(opcion==3)
opcion=3;
if(opcion==2)
opcion=3;
if(opcion==1)
opcion=2;
TimerFunction();
}
}



int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE GLUT_RGB);
glutInitWindowSize(500, 500);
glutCreateWindow("Reporte Practica 6");
glClearColor(0.0, 0.0, 0.0, 1.0);
init ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMouseFunc(onMouse);
glutTimerFunc(3000, TimerFunction, 1);
glutTimerFunc(30000, TimerFunction2, 2);
glutMouseFunc(onMouse);
glutMainLoop ();
return 0;}

Tuesday, April 10, 2007

Pusooy Games Tutorial

Improvement pending algorithm for m = 1 and m = Previous

Improvement Bresenham line algorithm


lineaBresenham void (int xo, yo, x1 , y1) {int dx = x1
-xo;
int dy = y1-yo;
int x = xo;
int y = I;
int do = 2 * dy-dx;
int dE = 2 * dy;
int DNE = 2 * (dy-dx);
int d = do;
int m = (y1-yo) / (x1-xo);
while (x! = x1) {
if (d <= 0){ //Direccion E
point ( x, y);
x = x + m;
d = d + dE;}

else {/ / Address
NE point (x, y);
x = x + m;
y = y +1;
d = d + DNE;

}}}


This code uses To sum the slope to calculate Tl x d, and so able to handle pendientesde m = 1 and m =- 1 or greater in value. Computer Graphics Group 2

Spanish Flea British Tv Theme

-1 or greater Bitmap Enhanced Practice 5 Practice version2

The last version does big guy's name is yes.


# include GL / glut.h

# include stdlib.h # include stdio.h
# include windows.h # include math.h


void text (GLuint x, GLuint and char * format) / / Paint the name
onMouse void (int button, int state, int x, int y) / / Events void
mouse button onMotion (int x, int y) / / mouse movement event
Glint increase = 0;
float alpha, beta,
int xo, yo;
void init (void) {

glClearColor (0.0, 0.0, 1.0, 0.0);
glShadeModel (GL_FLAT);}

void text (GLuint x, GLuint and char * format) {va_list args
;
char buffer [255], * p;
GLfloat font_scale = 33.33f 119.05f +;
va_start (args, format);
vsprintf (buffer, format, args )
va_end (args);
glMatrixMode (GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, glutGet(GLUT_WINDOW_WIDTH), 0,
glutGet(GLUT_WINDOW_HEIGHT));
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
glTranslatef(x, y, 0.0);
glRasterPos3f (90,180,0);
if(incrementa == 0)
for(p = buffer; *p; p++)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_10, *p);
if(incrementa == 1)
for(p = buffer; *p; p++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_10, *p);
if(incrementa == 2)
for(p = buffer; *p; p++)
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, *p);
if(incrementa == 3)
for(p = buffer; *p; p++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, *p);
if(incrementa == 4)
for(p = buffer; *p; p++)
glutBitmapCharacter(GLUT_BITMAP_9_BY_15, *p);
if(incrementa == 5)
for(p = buffer; *p; p++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, *p);
if(incrementa == 6)
for(p = buffer; *p; p++)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, *p);
if(incrementa >=7)
for(p = buffer; *p; p++)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, *p);
if(incrementa <= -1)
for(p = buffer; *p; p++)
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_10, *p);
//glRasterPos3f(500,0,0);
//glReadPixels(85,165,150,50,GL_RGB,GL_BITMAP,pix);
//glDrawPixels(150,50,GL_RGB,GL_BITMAP,pix);
//glColor3f(1.0,1.0,0.0);
//glBitmap (80,70,80, 180,10, 10,*p);
glPopAttrib();
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}
void onMouse(int button, int state, int x, int y)
{
if ( (button == GLUT_LEFT_BUTTON) & (state == GLUT_DOWN) ) {
incrementa++;
xo=x;
yo=y;
}
if ( (button == GLUT_RIGHT_BUTTON) & (state == GLUT_DOWN) ) {
incrementa--;
xo=x;
yo=y;
}
}
void onMotion(int x, int y) {
alpha = (alpha + (y - yo));
beta = (beta + (x - xo));
xo = x; yo = y;
glutPostRedisplay();
}
void display(void)
{
GLint command = 1;
glClear (GL_COLOR_BUFFER_BIT);
//glColor3f (1.0, 1.0, 1.0);
glLoadIdentity (); /* clear the matrix */
/* viewing transformation */
gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
if (command) {
glColor3f(1.0,1.,0.0) ;
text(250,200, "%s", "aide");
}
glFlush ();
}
void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0);
glMatrixMode (GL_MODELVIEW);
}
/* ARGSUSED1 */
void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
exit(0);
break;
}
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE GLUT_RGB);
glutInitWindowSize (500, 500);
glutInitWindowPosition (0,0);
glutCreateWindow (argv[0]);
init ();
glutDisplayFunc(display);
glutMouseFunc(onMouse);
glutMotionFunc(onMotion);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMainLoop();
return 0;
}

Monday, April 9, 2007

Welcome Board England Wedding

Previous Creation 5 glutBitmapCharacter

# include GL / glut.h

# include stdlib.h # include stdio.h
# include windows.h # include math.h


void text (GLuint x, GLuint and, GLfloat scale, char * format);
CrearFuente
Glint ();
EscribirCadena void (Glint source, char * string);
aux void (void);

void init (void) {

glClearColor (0.0, 0.0, 1.0, 0.0 )
glShadeModel (GL_FLAT);}


void text (GLuint x, GLuint and, GLfloat scale, char * format) {
GLvoid * pix;
va_list args;
char buffer [255], * p;
GLfloat font_scale = 33.33f 119.05f +;
va_start(args, format);
vsprintf(buffer, format, args);
va_end(args);
pix=NULL;
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, glutGet(GLUT_WINDOW_WIDTH), 0,
glutGet(GLUT_WINDOW_HEIGHT));
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);

glRasterPos3f (90,180,0);
for(p = buffer; *p; p++){
glutBitmapCharacter(GLUT_BITMAP_9_BY_15, *p);
//

}

glRasterPos3f(500,0,0);
glReadPixels(85,165,150,50,GL_RGB,GL_BITMAP,pix);
glDrawPixels(150,50,GL_RGB,GL_BITMAP,pix);
//glColor3f(1.0,1.0,0.0);
//glBitmap (80,70,80, 180,10, 10,*p);
glPopAttrib();
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}
void aux(void){
GLvoid *pix;
pix=NULL;
glReadPixels(0,0,500,500,GL_RGB,GL_BITMAP,pix);
glRasterPos3f(0,250,0);
glColor3f(1.0,0.0,0.0);
glDrawPixels(500,500,GL_RGB,GL_BITMAP,pix);
}

void display(void)
{
GLint command = 1;
glClear (GL_COLOR_BUFFER_BIT);
//glColor3f (1.0, 1.0, 1.0);
glLoadIdentity (); /* clear the matrix */
/* viewing transformation */
gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);


if (command) {
glColor3f(1.0,1.,0.0) ;
text(100,100, 80, "%s", "AIDE");
}
//aux();
glFlush ();
}

void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0);
glMatrixMode (GL_MODELVIEW);
}

/* ARGSUSED1 */
void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
exit(0);
break;
}
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE GLUT_RGB);
glutInitWindowSize (500, 500);
glutInitWindowPosition (0,0);
glutCreateWindow (argv[0]);
init ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMainLoop();

return 0;
}

Rose And Purple Dress

Previous Practice Name 5 Name Creation glutStrokeCharacter

#include GL/glut.h
#include stdlib.h
#include stdio.h
#include windows.h
#include math.h

void text(GLuint x, GLuint y, GLfloat scale, char* format);
void onMouse(int button, int state, int x, int y);
void onMotion(int x, int y);
GLint incrementa = 10;
float alpha, beta;
int xo, yo;

void init(void)
{
glClearColor (0.0, 0.0, 1.0, 0.0);
glShadeModel (GL_FLAT);
}

void text(GLuint x, GLuint y, GLfloat scale, char* format) {
va_list args;
char buffer[255], *p;
GLfloat font_scale = 119.05f + 33.33f;
va_start(args, format);
vsprintf(buffer, format, args);
va_end(args);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, glutGet(GLUT_WINDOW_WIDTH), 0,
glutGet(GLUT_WINDOW_HEIGHT));
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
glTranslatef(x, y, 0.0);
glScalef(scale/font_scale, scale/font_scale, scale/font_scale);
for(p = buffer; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
glPopAttrib();
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}
void onMouse(int button, int state, int x, int y)
{
if ( (button == GLUT_LEFT_BUTTON) & (state == GLUT_DOWN) ) {
incrementa = incrementa + 5;
xo=x;
yo=y;
}
if ( (button == GLUT_RIGHT_BUTTON) & (state == GLUT_DOWN) ) {
incrementa = incrementa - 5;
xo=x;
yo=y;
}
}

void onMotion(int x, int y) {
alpha = (alpha + (y - yo));
beta = (beta + (x - xo));
xo = x; yo = y;
glutPostRedisplay();
}

void display(void)
{
GLint command = 1;
glClear (GL_COLOR_BUFFER_BIT);
//glColor3f (1.0, 1.0, 1.0);
glLoadIdentity (); /* clear the matrix */
/* viewing transformation */
gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);

if (command) {
glColor3f(1.0,1.,0.0) ;
text(250,200, incrementa, "%s", "aide");
}

glFlush ();
}

void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0);
glMatrixMode (GL_MODELVIEW);
}

/* ARGSUSED1 */
void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
exit(0);
break;
}
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE GLUT_RGB);
glutInitWindowSize (500, 500);
glutInitWindowPosition (0,0);
glutCreateWindow (argv[0]);
init ();
glutDisplayFunc(display);
glutMouseFunc(onMouse);
glutMotionFunc(onMotion);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMainLoop();

return 0;
}

My Greenbeans Sparked In The Microwave

USE PRIOR PRACTICE 5 FUNCTION WATCH TIMER

#include GL/glut.h
#include stdlib.h
#include stdio.h
#include windows.h
#include math.h

void text(GLuint x, GLuint y, GLfloat scale, char* format);
void onMouse(int button, int state, int x, int y);
void onMotion(int x, int y);
void auxiliar(void);
void TimerFunction(int value);

int h1,h2,m1,m2,s1,s2;
GLint incrementa = 20;
float alpha, beta;
int xo, yo,sigue;
s1=0;
m1=0;
h1=0;
s2=0;
m2=0;
h2=0;
sigue=0;
void init(void)
{
glClearColor (0.0, 0.0, 1.0, 0.0);
glShadeModel (GL_FLAT);
}

void text(GLuint x, GLuint y, GLfloat scale, char *format) {
va_list args;
char buffer[255], *p;
GLfloat font_scale = 119.05f + 33.33f;
va_start(args, format);
vsprintf(buffer, format, args);
va_end(args);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, glutGet(GLUT_WINDOW_WIDTH), 0,
glutGet(GLUT_WINDOW_HEIGHT));
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);
glTranslatef(x, y, 0.0);
glScalef(scale/font_scale, scale/font_scale, scale/font_scale);
for(p = buffer; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
glutStrokeCharacter(GLUT_STROKE_ROMAN, h2+48);
glutStrokeCharacter(GLUT_STROKE_ROMAN, h1+48);
glutStrokeCharacter(GLUT_STROKE_ROMAN, 58);
glutStrokeCharacter(GLUT_STROKE_ROMAN, m2+48);
glutStrokeCharacter(GLUT_STROKE_ROMAN, m1+48);
glutStrokeCharacter(GLUT_STROKE_ROMAN, 58);
glutStrokeCharacter(GLUT_STROKE_ROMAN, s2+48);
glutStrokeCharacter(GLUT_STROKE_ROMAN, s1+48);
glPopAttrib();
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}
void TimerFunction(int value)
{
s1++;
if(s1==10){
s2++;
s1=0;
if(s2==6){
s2=0;
m1++;
if(m1==10){
m1=0;
m2++;
if(m2==6){
m2=0;
h1++;
if(h1==10){
h1=0;
if(h2==2){
m1=m2=s1=s2=h1=h2=0;
}
}
}
}
}
}
glutPostRedisplay();
if(sigue==1)
glutTimerFunc(1000,TimerFunction,1);
}

void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0);
glMatrixMode (GL_MODELVIEW);
}

/* ARGSUSED1 */
void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
exit(0);
break;
}
}
void onMouse(int button, int state, int x, int y)
{
if ( (button == GLUT_LEFT_BUTTON) & (state == GLUT_DOWN)) {
sigue=1;
auxiliar();
xo=x;
yo=y;
}

if ( (button == GLUT_RIGHT_BUTTON) & (state == GLUT_DOWN) ) {
sigue=0;

xo=x;
yo=y;
}

}

void onMotion(int x, int y) {
alpha = (alpha + (y - yo));
beta = (beta + (x - xo));
xo = x; yo = y;
glutPostRedisplay();
}

void display(void)
{
GLint command = 1;
glClear (GL_COLOR_BUFFER_BITGL_DEPTH_BUFFER_BIT);

glLoadIdentity (); /* clear the matrix */
/* viewing transformation */
gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);

if (command) {
glColor3f(1.0,1.,0.0) ;
text(250,200, incrementa, "%s","Reloj ");
}

glutSwapBuffers();
}


int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE GLUT_RGB);
glutInitWindowSize (500, 500);
glutInitWindowPosition (0,0);
glutCreateWindow (argv[0]);
init ();
glutDisplayFunc(display);
glutMouseFunc(onMouse);
glutMotionFunc(onMotion);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMainLoop ();
return 0;}


auxiliary void (void) {
if (still == 1)
glutTimerFunc (1000, TimerFunction, 1);}

Gay Dogging In South Beach Miami

Previous 5 Part 1


API_GLUT

glutCreateWindow int (char * name)
create the window, and the parameter is the name of it. name: string with the name of the window. Returns an integer that is the unique identifier of the window. This function creates a main window. When you create a window, active window becomes the new window. All window implies a context of OpenGL. This context is one that allows the window created with GLUT (or where appropriate, with any windowing environment) to come in contact with OpenGL. Windows created with this function are not displayed yet. The display will carry out a response function to redraw event window.

glutInit void (int * argc, char ** argv)
argc: argc parameter pointer to the main function of the program.
argv: argv parameter of main function. GlutInit
initializes the GLUT library, spend pudiéndosele command line parameter through argc and argv. This routine must be called once at the beginning of the program. Any other function that can not be called before initialization. If we use some
initialization function (with the prefix glutInit-) before this function, we are setting the default state of the application to initialize.

glutInitWindowSize void (int width, int height)
width: window width in pixels
height: window height in pixels
This routine is used to indicate the initial size of the windows that are created.

glutInitWindowPosition void (int x, int y)
x: x position of the window in pixels
y: position and the window in pixels
With this function we set the initial position of the windows that you create. Initialize the position of the window on the desktop.

glutInitDisplayMode void (unsigned int mode)
Initializes the display mode.
mode: display mode. It is a composition by connectors "
some of the following values:
GLUT_RGBA: Select a RGBA mode window. This is the default if not listed or not GLUT_RGBA GLUT_INDEX are specified.
GLUT_RGBA: Same as GLUT_RGBA.
GLUT_INDEX: Select a window in color index mode. Is imposed on GLUT_RGBA.
GLUT_SINGLE: Select a single buffered window. This is the default.
GLUT_DOUBLE: Select a double buffered window. Is imposed on GLUT_SINGLE.
GLUT_ACCUM: Select a window with an accumulation buffer.
GLUT_ALPHA: Select a window with an alpha component color buffer.
GLUT_DEPTH: Select a window with a depth buffer.
GLUT_STENCIL: Select a window with a stencil buffer.
GLUT_MULTISAMPLE: Select a window with multisample support.
GLUT_STEREO: Select a stereo window.
GLUT_LUMINANCE: Select a window with a color pattern in shades of gray.
This function sets the initial display mode that will create the windows. The two values \u200b\u200bthat tend to occur in most applications are GLUT_RGBA, to set an RGB color model with alpha component and GLUT_DOUBLE to select a window with double buffering.

glutDisplayFunc (void (* func) (void));
The function func () is called each time you have to redraw the window.
GLUT does not provide a default response function for the redraw, so it is required to write a function of this type for each window created. If you create a window and not recorded the response function to redraw, it fails.

glutInitPosition (int x, int y);
Y position of top left corner of the new window, with respect to the desktop in which they work.

glutKeyboardFunc (void (* func) (unsigned char key, int x, int y));
func: callback function to the event.
is used to register the function that responds to keyboard events on the window. The response function parameters must have the key has been pressed (ASCII character) and position (x, y) of the mouse pointer at the time on the window. Not be detected directly modifier keys (CTRL, ALT, ...). We use for this function glutGetModifiers. If no input function keyboard events are ignored.

glutMainLoop ();
This routine must be called once in the program. Since it implements an infinite loop (actually the loop terminates when an application close event), the function never ends. It is therefore necessary to pre-register callback functions and also the call to this function is the last main.

glutMouseFunc (void (* func) (int button, int state, int x, int y));
Add to the active window function response to mouse events. Mouse events occur both when pressed and when a button is released mouse. The parameters of the response function must be the button (GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON or GLUT_RIGHT_BUTTON), the state of the button (or GLUT_DOWN GLUT_UP) and position (x, y) of the pointer on the window.
When a menu attached to a button of the mouse, click the button event is ignored, prevailing over other menu features. As in the case of the keyboard, you can detect the use of switches with glutGetModifiers function. Failure to register a response function to mouse events, they are ignored.

glutReshapeFunc (void (* func) (int width, int high));
Add function response to the event of resizing the window. The response function should have as parameters the width and height of the window after resizing. GLUT provides in this case, a default response function, which is used when no input function for this event. Resizing the main window does not generate any events resizing of subwindows, so it's being done explicitly.

glutPostRedisplay ();
Calls redraw the current window.

glutSolidCone (Gldouble base, Gldouble height, Glint slices, Glint stacks);
Draw a solid cone with a radio base length, a height, number of divisions around the z axis (slices) and number of divisions along the z axis

glutWireCone (Gldouble base, Gldouble height, Glint slices, Glint stacks);
lines Draw a cone with a radius of base length, a height, number of divisions around the z axis (slices) and number of divisions along the z axis

glutSolidCube (Gldouble size);
Draw a solid cube with each side length size.

glutWireCube (Gldouble size);
Draw a cube with lines, with each side length size.

glutSolidDodecahedron ();
Draw a solid dodecahedron.

glutWireDodecahedron ();
Draw a dodecahedron with lines.

glutSolidIcosahedron ();
Draw a solid icosahedron.

glutWireIcosahedron ();
Draw an icosahedron with lines.

glutSolidOctahedron ();
Draw a solid octahedron.

glutWireOctahedron ();
Draw an octahedron with lines.

glutSolidSphere (Gldouble radius, Glint slices, Glint stacks);
Draws a solid sphere, the parameters are the radius, number of divisions around z axis (slices) and number of divisions along the z axis

glutWireSphere (Gldouble radius, Glint slices, Glint stacks);
Draw a sphere with lines, the parameters are the radius, number of divisions around the z axis (slices) and number of divisions along the z axis

glutSolidTetrahedron ();
Draw a solid tetrahedron.

glutWireTetrahedron ();
Draw a tetrahedron with lines.

glutSolidTorus (Gldouble innerRadius, Gldouble outerRadius, Glint nside, Glint nRings)
Draw a solid torus, the parameters are the inner radius, outer radius, number of radial divisions for each section nside, and number of radial sections nRings.

glutWireTorus (Gldouble innerRadius, Gldouble outerRadius, Glint nside, Glint nRings)
lines Draw a torus, the parameters are the inner radius, outer radius, number of radial divisions for each section nside, and number of radial sections nRings.

glutSolidTeapot (Gldouble size);
Draw a solid teapot with a radius size.

glutWireTeapot (Gldouble size);
Draw Lines with a teapot with a radius size.

glutSpecialFunc (void (* func) (int key, int x, int y));
Add to the active window press event a special key. The key parameter can be GLUT_KEY_Fn for function keys (n = 1, 2, ..., 12), GLUT_KEY_RIGHT, GLUT_KEY_LEFT, GLUT_KEY_UP, GLUT_KEY_DOWN, GLUT_KEY_PAGE_UP, GLUT_KEY_PAGE_DOWN, GLUT_KEY_HOME, GLUT_KEY_END, GLUT_KEY_INSERT, GLUT KEY F1, F2 GLUT KEY, GLUT KEY F3, F4 KEY GLUT, GLUT KEY F5, F6 KEY GLUT, GLUT KEY F7, F8 KEY GLUT, GLUT KEY F9, GLUT KEY F10, F11 KEY GLUT, GLUT KEY F12.

glutSwapBuffers void (void)
Swap buffers in the current window. It is used to double buffer mode. This important feature of OpenGL (and by extension GLUT) causes reduced to a minimum during the redraw flicker, especially if there are animations. The window has two buffers: one visible and one invisible. The drawing is done in the hidden buffer, exchange, draw it all at once, eliminating flicker. This theme is dealt with in detail when we see OpenGL.

glutTimerFunc (unsigned int msecs, (* func) (int value), int value);
msecs: number of milliseconds the timer
func: Function
response to the event value: Value to be used to call Add response function as both a timer function response.
We indicate the time in milliseconds, a timer identification value and serves the same function, whose only parameter must be the timer identifier. Int


glutGet (GLenum state)
state: specific variable we wish to state for the information.
Returns an integer indicating the value of the variable referenced.
This function returns the value of a state variable. The state parameter refers to the variable we want to know its value. This parameter is a value of an enumeration, whose values \u200b\u200bare GLUT_WINDOW_X, GLUT_WINDOW_Y, for the position of the active window, GLUT_WINDOW_WIDTH, GLUT_WINDOW_HIGHT, for the size of the active window, GLUT_WINDOW_PARENT, to get the ID of the parent window of the active, etc. GLUT WINDOW
XX pixel location to the origin, location on GLUT WINDOW YY, GLUT WINDOW WIDTH width, GLUT WINDOW HEIGHT high GLUT WINDOW BUFFER SIZE number of bits in the window color can be also GLUT WINDOW RED SIZE to shades of red, GLUT WINDOW GREEN SIZE green hue
GLUT WINDOW BLUE SIZE shade of blue, and alpha GLUT WINDOW ALPHA SIZE. GLUT WINDOW STENCIL SIZE
number of bits in the stencil buffer.
GLUT WINDOW DEPTH SIZE Number of bits in the current window's depth buffer.
GLUT WINDOW ACCUM RED SIZE number of bits accumulated in the buffer which are red, GLUT WINDOW ACCUM GREEN Green SIZE, GLUT WINDOW ACCUM BLUE SIZE blue and GLUT WINDOW ACCUM ALPHA SIZE WINDOW alfa.GLUT DoubleBuffer if double buffering is enabled, if GLUT WINDOW RGBA RGBA mode, GLUT WINDOW PARENT number of parent window, GLUT WINDOW NUM CHILDREN number child windows, GLUT WINDOW SIZE colormap color index size, GLUT WINDOW NUM SAMPLES number of examples, if you drive GLUT WINDOW STEREO stereo, GLUT WINDOW CURSOR for cursor, GLUT SCREEN WIDTH screen width in pixels, GLUT SCREEN HEIGHT pixels high Online, GLUT SCREEN WIDTH MM screen width in millimeters, GLUT SCREEN HEIGHT MM screen height in millimeters, GLUT MENU NUM ITEMS number of items in the menu, GLUT DISPLAY MODE POSSIBLE screen mode supported, GLUT INIT DISPLAY MODE initial screen with a mask, GLUT INIT WINDOW X initial value of x, GLUT INIT WINDOW AND initial value of the position and GLUT INIT WINDOW WIDTH initial width of the screen, GLUT INIT WINDOW HEIGHT initial height of the screen, GLUT ELAPSED TIME number in milliseconds since the call glutIni glutGet. Int

glutDeviceGet (GLenum info)
info: device on which information
Returns information about the device indicated
Get information about system devices. The parameter indicates the device info: GLUT_HAS_KEYBOARD, GLUT_HAS_MOUSE, GLUT_NUM_MOUSE_BUTTONS, etc. In the first two cases, the function returns 0 if no such device and another value if it exists. In the third case, returns the number of mouse buttons. There enumeration values \u200b\u200bfor other devices.

glutGetModifiers int (void)
Returns a value indicating the switch has been pressed.
Returns the modifier key has been pressed: GLUT_ACTIVE_SHIFT, GLUT_ACTIVE_CTRL or GLUT_ACTIVE_ALT. The GLUT library can perform many other actions, relating to the use of color, the display of text, layers and control the design of some geometric primitives.

glutIdleFunc void (void (* function) (void))
function: the event response function records the function
idle response to the event. This event occurs every time the system has no other event to attend. OpenGL is commonly used to make animations. The function that responds to the event should be as small as possible to avoid loss in the ability of interaction of the application.

glutMenuStatusFunc void (void (* function) (int state, int x, int y))
function: role of response to the event
Add the function that responds to the event that occurs when you expand or collapse a menu . The state parameter can be worth GLUT_MENU_IN_USE when a menu is displayed, or GLUT_MENU_NOT_IN_USE when folded. The values \u200b\u200b(x, y) are the position mouse pointer in each case.

glutMotionFunc void (void (* function) (int x, int y))
The function func (x, y) is called when the mouse is moved while pressed one of its buttons. Add to the window
activate a response to mouse movements when a button is pressed it. The parameters (x, y) indicate the position of the pointer coordinates relative to the window.

glutPassiveMotionFunc void (void (* function) (int x, int y))
Add to the active window function response to mouse movements when you are not holding any buttons thereof. The parameters (x, y) indicate the position of the pointer coordinates relative to the window.

glutVisibilityFunc void (void (* function) (int state)): Add
for the active window response function to the event of changes in the visibility of the window. The state parameter can be GLUT_NOT_VISIBLE or GLUT_VISIBLE.

glutEntryFunc void (void (* function) (int state)): Add
for the active window function response to the event and out of the mouse in the area of \u200b\u200bthe window. The state parameter can be GLUT_LEFT or GLUT_ENTERED.

glutCreateSubWindow int (int idVentanaPadre, int x, int y, int width, int height)
idVentanaPadre: ID of the parent window of the subwindow
x, y: position (x, y) in pixels subwindow on the parent window width, height: width and height in pixels subwindow. Returns a unique identifier for the subwindow
This routine creates a subwindow, the daughter of the window identified by idVentanaPadre. The active window of the application becomes the new subwindow. As in the case of the main windows, the view objects are associated with a display context, and display mode is given by the initial specifications (but not its size and position, which in this case are given explicitly).

glutSetWindow void (int idVentana)
idVentana: ID window Fixed window
idVentana identified as the active window.

glutGetWindow int (void)
Returns the ID of the active window

glutDestroyWindow void (int idVentana)
idVentana: identifier of the window. Destroy the window identified by idVentana.

glutPositionWindow void (int x, int y)
x, y: position (x, y) in pixels of the window
Calls for change in the current window position on screen. If the current window is principal, (x, y) is taken with reference to the origin screen. If a view object, the distance is taken with reference to the origin of the parent window.

glutReshapeWindow void (int width, int height)
width: window width in pixels
height: height of the window pixels Calls
change the current window size, giving the width and height specified.
Other functions relating to the windows shown below along with a brief description.

glutFullScreen void (void):
Requests that the current window is maximized. Only works for main windows.

glutPopWindow void (void):
one advances the current window position in the stack of windows.

glutPushWindow void (void):
delay the current window position in the window stack.

glutShowWindow void (void):
Displays the current window.

glutHideWindow void (void):
Hide the current window.

glutIconifyWindow void (void): Calls
minimizing the current window and its conversion into an icon.

glutSetWindowTitle void (char * name):
Rename the current window.

glutSetIconTitle void (char * name):
gives its name to the current window when minimized.

glutSetCursor void (int cursor):
Change mouse pointer when hovering the current window. The parameter is an enumeration value.
GLUT CURSOR RIGHT ARROW, LEFT ARROW CURSOR GLUT, GLUT CURSOR INFO, GLUT CURSOR DESTROY, GLUT CURSOR HELP, GLUT CURSOR CYCLE, GLUT CURSOR SPRAY,
GLUT CURSOR WAIT, GLUT CURSOR TEXT, GLUT CURSOR CROSSHAIR, GLUT CURSOR UP DOWN, GLUT LEFT CURSOR RIGHT, GLUT CURSOR TOP SIDE BOTTOM SIDE ROCKER GLUT, GLUT CURSOR LEFT SIDE, RIGHT SIDE ROCKER GLUT, GLUT CURSOR TOP LEFT CORNER, GLUT CURSOR TOP RIGHT CORNER, GLUT CURSOR BOTTOM RIGHT CORNER, GLUT CURSOR BOTTOM LEFT CORNER, GLUT CURSOR FULL CROSSHAIR, GLUT CURSOR CROSSHAIR)., GLUT CURSOR NONE, GLUT CURSOR INHERIT.

glutCreateMenu int (void (* function) (int value))
This function creates a menu (still no options), and assigns the function func (value). This function will be called whenever a menu option is selected by the user, and you will receive the code value identifying the selected option. Thus, we can define what each menu item. Returns a handle to menu
we will when we have to refer to it.
function: callback function to call when you select a menu item.
The value that is passed to the function identifies the menu item.
Returns a unique identifier for the menu.
This function creates a floating menu associated with the current window and returns a unique identifier for it. This menu becomes the active menu.

glutSetMenu void (int idMenu)
This function causes the menu idmenu be identified as the current menu.
By default, the current menu is the last to be created.
idMenu: identifier of the menu.
This puts the menu idMenu identified as active menu.

glutGetMenu int (void) Returns an identifier
menu. Returns the ID the active menu.

glutDestroyMenu void (int idMenu)
idMenu: menu handle. Destroy the menu identified by idMenu.

glutAddMenuEntry void (char * name, int value)
Add a menu option to the current menu. This option is called
name and be identified by the number value.
name: character string that appears in the menu item value: identifier for the menu item. This value is passed to the response function to the menu.
Adds a menu entry at the end of the asset, and the string that is displayed is the name. When the user selects this option, is called the response function with the value as a parameter.

glutAddSubMenu void (char * name, int idMenu)
Adds a menu item that opens a submenu.
name: character string that appears in the main menu option.
idMenu: ID of the submenu to the item.
Creates a menu item is associated with a submenu that is displayed when selected the main menu entry. The submenu must have been created previously as any other menu.


glutChangeToSubMenu void (int entry, char * name, int value):
other changes a submenu.

glutRemoveMenuItem void (int input):
Deletes a menu entry.

glutDetachMenu void (int button):
Removes the association between active menu and mouse.

glutAttachMenu void (int button)
button: mouse button to associate the menu. Associates the current menu
a mouse button in the active window, so that the menu is displayed when you press the mouse button. The button can be worth GLUT_LEFT_BUTTON, GLUT_RIGHT_BUTTON GLUT_MIDDLE_BUTTON or to associate with the left button, center or right respectively.

void glutChangeToMenuEntry (int entry, char * name, int value):
Change the input (the input parameter is the index of the same, starting at 1) by a different one. This function is to modify an existing menu item. The entry parameter indicates the option to change (for example, to modify the first entry = 1), name will be the new name of the option and the new ID value that will be passed to the handler function menu.

glutEstablishOverlay void (void);
Sets the layer. Void

glutUseLayer (GLenum layer);
Use layer.

glutRemoveOverlay void (void);
Removes the current layer.

glutPostOverlayRedisplay void (void);
Mostra the next layer.

glutShowOverlay void (void);
Show layer.

glutHideOverlay void (void);
shows the texture of the layer.

glutOverlayDisplayFunc void (void (* func) (void));
devulve Create a function that the layer to display.

v oid glutSpaceballMotionFunc (void (* func) (int x, int y, int z)); Puts
Spaceball movement in the current window.

glutSpaceballRotateFunc void (void (* Func) (int x, int y, int z));
Sets the Spaceball rotation depending on the current window.

glutSpaceballButtonFunc void (void (* func) (int button, int state)); Spaceball
Sets the current window.

glutButtonBoxFunc void (void (* func) (int button, int state));
Sets the dial & button box box via a callback in the current window.

glutDialsFunc void (void (* func) (int dial, int value));
Sets the dial & button box box via a callback in the current window.

glutTabletMotionFunc void (void (* func) (int x, int y));
Place special keyboard through a callback in the current window.

glutSetColor void (int cell, network GLfloat, GLfloat green, GLfloat blue);
Sets the color map between the application layer and the current window. GLfloat

glutGetColor (int cell, int component) Returns
green, red or blue in color because the color index map between the application layer and the current layer.

glutCopyColormap void (int win);
color copy of the map to the layer using a specified window. Int

glutLayerGet (GLenum info);
GLUT Returns the status of belonging to the layers of the current window. The information is about:
GLUT OVERLAY, GLUT LAYER IN USE, NORMAL GLUT, GLUT OVERLAY, GLUT HAS OVERLAY, GLUT TRANSPARENT INDEX, GLUT NORMAL DAMAGED, GLUT OVERLAY DAMAGED. Int

glutDeviceGet (GLenum info);
Retrieves information about the use of GLUT represented by integers.
GLUT HAS KEYBOARD, GLUT HAS MOUSE HAS SPACEBALL GLUT, GLUT HAS DIAL AND BUTTON BOX,
GLUT HAS TABLET, returning non-zero if it is viable, zero if it is not viable. GLUT NUM MOUSE BUTTONS
Number of buttons supported by mouse. If there maouse returns 0. GLUT NUM
SPACEBALL BUTTONS number of buttons that supports the Spaceball.
GLUT NUM BUTTON BOX BUTTONS Number of buttons that supports dial & ButtonBox. GLUT NUM
number of selectors for the dial & button box
GLUT NUM TABLET BUTTONS Number of buttons supported by the tablet.

glutGetModifiers int (void);
Return the modification of key state when certain callbacks were generated. GLUT ACTIVE
SHIFT modifier if the shift or caps were activated. GLUT ACTIVE CTRL
if Ctrl was pressed. GLUT ACTIVE ALT
if amended H.

glutExtensionSupported int (char * extension);
Help facilitated if some certain extensions are supported by OpenGL.

glutBitmapCharacter void (void * font, int character);
Returns the width in pixels of a character type dependent bitmap font which can be:
GLUT BITMAP 8 BY 13 Fixed a font where each side b is a rectangle of size 8 by 13 pixels. GLUT BITMAP
9 BY 15 Fixed a font where each side b is a rectangle of size 9 by 15 pixels.
GLUT BITMAP TIMES ROMAN 10 Relative to Times Roman size 10.
GLUT BITMAP TIMES ROMAN 24 Relative to Times Roman size 24.
GLUT BITMAP HELVETICA 10 Helveltica Proportional to size 10. GLUT BITMAP HELVETICA
December 1910 Helveltica Proportional to size 12. GLUT BITMAP HELVETICA
October 18 Helveltica Proportional to Size 18. Int

glutBitmapWidth (GLUTbitmapFont font, int character);
Returns the width in pixels of a bitmap type character depending on the source.

glutStrokeCharacter void (void * font, int character);
stroke represents a character type with a font that can be defined:
GLUT STROKE ROMAN A gives a Roman type font size is 119.05 units maximum and minimum 33.33 units.
GLUT STROKE MONO ROMAN A. Int

glutStrokeWidth (GLUTstrokeFont font, int character);
Returns the width in pixels of a character stroke depending on the font type.


Can You Wank On Coke?

Practice PRACTICE REPORT 4

In practice, I talk about double buffering in GLUT is given by DoubleBuffer, indicating twice the storage space in this space used to store data and reduces flicker in the image, that when you draw a picture and clears the running time increases, this feature reduces the time that you have only 1 instead of buffer there are two.

function parameters are:

glutInitDisplayMode (GLUT_DOUBLEGLUT_RGBGLUT_DEPTH)

where:

GLUT_DOUBLE: Prevents flickering, double buffer.
GLUT_RGBA: Sets the color red, green and blue.
GLUT_DEPTH: Evidence indicates depth, also called the z buffer.

As seen in practice has been used glFlush function (), this function is responsible for emptying the contents of Frame Buffer on the video screen.

double buffering to use a function similar to glFlush () called glutSwapBuffers (), which is responsible swap the buffers when using this feature, glFhush () is redundant and can be ignored.

functions are also speak as

glClear (GL_COLOR_BUFFER_BITGL_DEPTH_BUFFER_BIT), which is responsible for cleaning the screen where the pixels are.

glutPostRedisplay (); Creates an element according to redraw modifications, is forced to redraw event.

glutSpecialFunc (), which is used to define the F1-F12 keys, and other special.


These functions are explained in detail in API_GLUT shown in this blog

Sunday, April 8, 2007

White Guys Dont Like Big



IMPROVED ALGORITHM Void
line (int x, I, x1, y1)

{int y = y0;
flot mint x = x0;
m = (y1-y0) / (x1-x0);
point (x, y), if (m <0) m="m*(-1);
"> do {x = x +1, y = y + m +0.5;
point (x, y);
} while (and! = y1);