Recent Posts

Pages: 1 [2] 3 4 5
11
Computer Science IT Tutorials / opengl glut visual c++ sample program
« Last post by admin1 on April 11, 2017, 03:26:23 PM »
#include <iostream>
#include<conio.h>
#include<GL/glut.h>

using namespace std;
int cx=0, cy=0,cz=0;
int cn;

struct Quads
{
int x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4;
float r,g,b;
int state;
int total;
}; Quads Q[100];

void addQuad()
{
   Q[0].state++; if(Q[0].state>4) { Q[0].state=1;}
   int st=Q[0].state;
if (st==1){Q[0].total++; cn= Q[0].total;}
if(st==1){Q[cn].x1=cx; Q[cn].y1=cy; Q[cn].z1=cz; }
if(st==1||st==2){Q[cn].x2=cx; Q[cn].y2=cy; Q[cn].z2=cz; }
if(st==1||st==2||st==3){Q[cn].x3=cx; Q[cn].y3=cy; Q[cn].z3=cz; }
if(st==1||st==2||st==3||st==4){Q[cn].x4=cx; Q[cn].y4=cy; Q[cn].z4=cz; }
}

void drawQuads()
{
int i;
for(i=1;i<Q[0].total+1;i++)
{
   glBegin(GL_QUADS);
   glColor3f(Q.r,Q.g,Q.b);
   glVertex3f(Q.x1,Q.y1,Q.z1);
   glVertex3f(Q.x2,Q.y2,Q.z2);
   glVertex3f(Q.x3,Q.y3,Q.z3);
   glVertex3f(Q.x4,Q.y4,Q.z4);
   glEnd();
}


}


void theCube()
{
   glPushMatrix();
   glTranslatef(cx,cy,cz);
   glColor3f(1,1,1);
   glutSolidCube(0.4);
   glPopMatrix();
}
void drawGrid()
{
   int i;
   for(i=0;i<40;i++)
   {
   glPushMatrix();
   if(i<20){glTranslatef(0,0,i);}
   if(i>=20){glTranslatef(i-20,0,0); glRotatef(-90,0,1,0);}
   
   glBegin(GL_LINES);
   glColor3f(1,1,1); glLineWidth(1);
   glVertex3f(0,-0.1,0); glVertex3f(19,-0.1,0);
   glEnd();
   glPopMatrix();
      }
}
void display()
{

   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   glLoadIdentity();
   glScalef (-0.1, -0.1, -0.1);
   glTranslatef(-6,1,0);
   glRotatef(40,1,1,0);
   drawGrid();
   drawQuads();
   theCube();
   glutSwapBuffers();
}
void init()
{
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
   gluPerspective(35,1.0f,0.1f,500);
   glMatrixMode(GL_MODELVIEW);
   glEnable(GL_DEPTH_TEST);
   glClearColor(0.2,0.2,0.2,1);
   
}

void keyboard(unsigned char key,int x,int y)
{
   if(key=='w'){cz-=1;} if(key=='s'){cz+=1;}
   if(key=='a'){cx-=1;} if(key=='d'){cx+=1;}
   if(key=='q'){cy+=1;} if(key=='z'){cy-=1;}

   if(key==32){addQuad();}
   
   if(key=='r'){Q[cn].r=1; Q[cn].g=0; Q[cn].b=0;}
   if(key=='g'){Q[cn].r=0; Q[cn].g=1; Q[cn].b=0;}
   if(key=='b'){Q[cn].r=0; Q[cn].g=0; Q[cn].b=1;}
   if(key=='y'){Q[cn].r=1; Q[cn].g=1; Q[cn].b=0;}
   //if(key=='r'){cx=0; cy=0;cz=0;} 
   glutPostRedisplay();

}



int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE);
glutInitWindowSize(800,600);
glutCreateWindow("");
glutDisplayFunc(display);
glutKeyboardFunc(keyboard);
glutMainLoop();
return 0;
}

/*

int main()
{
   cout << "Hello World!" << endl;

   getch();
   return 0;
}
*/
13
CGSB (Canadian Certification) Level 2 Technicians Job vacancy

Requirements

minimum of UT2/MT2/PT2  or  RT2/MT2/PT2

Interested candidates Please email your resume to info@ndtgroup.ca 

for mechanical engineer NDT jobs
recruitment free visa ndt canada jobs careers
14
Mechanical Engineering Jobs / JOB : NDT UT and MT CGSB Level 2 Positions CANADA
« Last post by admin1 on March 24, 2017, 05:04:17 PM »
NDT UT MT Lavel 2 Jobs in CANADA

Job Location: Alberta

Requirements: Pipeline Integrity experience


Contact Spectrum at inquiries@spectrumndt.com to discuss these opportunities.

more mechanical engineer jobs
NDT JOBS
Non destructive testing jobs Canada
Recruitment in Canada
Free Job Visa in Canada for mechanical Engineers
15
Computer Science IT Tutorials / good reads for open gl
« Last post by admin1 on March 24, 2017, 04:46:38 AM »
17
Mechanical Engineering Jobs / Mechanical Designer job Toronto
« Last post by admin1 on December 20, 2016, 03:11:48 AM »
Job Type    Permanent or Direct Contract
Education    College or University diploma or degree in Mechanical Engineering
Duties / Responsibilities    QUALITIES AND EXPECTATIONS Introducing a fresh approach.Bringing creative ideas and thinking outside the box.
Interfacing with the entire team to integrate the various components (ergonomic, electronic, market, etc.)

apply : http://www.trans-united.net/application_form.php
18
Computer Science IT Tutorials / what is stencil buffer in OpenGL
« Last post by admin1 on October 22, 2016, 08:03:24 AM »
the stencil buffer is used to restrict drawing to certain portions of the
screen. Think of it like a cardboard stencil that can be used with a can of
spray paint to make fairly precise painted images. For example, a classic use
is to simulate the view of a rear-view mirror in a car. You render the shape
of the mirror to the stencil buffer, and then draw the entire scene. The
stencil buffer prevents anything that wouldn’t be visible in the mirror from
being drawn.

graphics programming interview questions
19
Computer Science IT Tutorials / what is Depth Buffer in OpenGL
« Last post by admin1 on October 22, 2016, 08:02:14 AM »
The depth buffer stores a depth value for each pixel, and is used for
determining the visibility of objects in a three-dimensional scene. Depth is
measured in terms of distance to the eye, so pixels with larger depth-buffer
values are overwritten by pixels with smaller values
20
Computer Science IT Tutorials / Re: Configure OpenGL GLEW GLUT in Visual Studio
« Last post by admin1 on October 08, 2016, 02:39:13 AM »
another best tutorial to set up open gl in C++ (visual studio)
https://www.badprog.com/c-opengl-setting-up-visual-studio
Pages: 1 [2] 3 4 5