Selamat Datang Di Blogg Saya
Tampilkan postingan dengan label Microsoft visual studio 2008. Tampilkan semua postingan
Tampilkan postingan dengan label Microsoft visual studio 2008. Tampilkan semua postingan

Jumat, 20 April 2012

Membuat Objek dan Garis dengan DDA dan Bresenham

/* pratikum 04
*membuat objek dan garis dengan DDA dan Bresenham
*/

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <glut.h>
#include <math.h>

void display(void)
{
//set display-window background color to white
glClearColor(1.0, 1.0, 1.0, 0.0);
//set projection parameters
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0, 300.0, 0.0, 300.0);
}
void setPixel(GLint xCoordinate, GLint yCoordinate)
{
glBegin(GL_POINTS);
glVertex2i(xCoordinate,yCoordinate);
glEnd();
glFlush();
}

Selasa, 10 April 2012

Membuat Objek Primitif : Poligon

/* pratikum 03
*membuat objek primitif : poligon
*/

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <glut.h>

void display(void)
{
GLubyte fly[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x80, 0x01, 0xC0, 0x06, 0xC0, 0x03, 0x60,
0x04, 0x60, 0x06, 0x20, 0x04, 0x30, 0x0C, 0x20,
0x04, 0x18, 0x18, 0x20, 0x04, 0x0C, 0x30, 0x20,
0x04, 0x06, 0x10, 0x20, 0x44, 0x03, 0xC0, 0x22,
0x44, 0x01, 0x80, 0x22, 0x44, 0x01, 0x80, 0x22,
0x44, 0x01, 0x80, 0x22, 0x44, 0x01, 0x80, 0x22,
0x44, 0x01, 0x80, 0x22, 0x44, 0x01, 0x80, 0x22,
0x66, 0x01, 0x80, 0x66, 0x33, 0x01, 0x80, 0xCC,
0x19, 0x81, 0x81, 0x98, 0x0C, 0xC1, 0x83, 0x30,
0x07, 0xe1, 0x87, 0xe0, 0x03, 0x3f, 0xfc, 0xc0,
0x03, 0x31, 0x8c, 0xc0, 0x03, 0x33, 0xcc, 0xc0,
0x06, 0x64, 0x25, 0x60, 0x0c, 0xcc, 0x33, 0x30,
0x18, 0xcc, 0x33, 0x10, 0x10, 0xc4, 0x23, 0x08,
0x10, 0x63, 0xc6, 0x08, 0x10, 0x30, 0x0c, 0x08,
0x10, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, 0x08};

Senin, 02 April 2012

Penggambaran Objek Garis

/* pratikum 02
*membuat objek primitif : titik, garis
*/

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <glut.h>

#define drawOneLine(x1,y1,x2,y2) glBegin(GL_LINES); \
glVertx2f ((x1),(y1)); glVertex2f ((x2),(y2)); glEnd();
void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
}

Senin, 19 Maret 2012

Microsoft visual studio 2008

 langkah-langkah memulai project di microsoft visual studio 2008

1. buka aplikasi microsoft viasual studio 2008
2. pilih menu file -> new -> project.
3. pilih Win32 console Aplication dan beri nama Projecnya, misal: praktikum_1.
   Klik next, kemudian pada Additional Options, contreng pilihan Empty project.
   merupakan project yang kita mulai dari dasar,bukan dari template yang disediakan
   oleh microsoft visual studio.
4. jika project sudah berhasil tercreate, maka pada microsoft visual studio di
   bagian paling kiri akan muncul folder project yang baru kita buat. klik kanan
   pada folder source files,lalu pilih menu Add -> New Item, pilih C++ file(.cpp),
   kemudian beri nama, misal: project.
5. buka file project.cpp pada editor kede program, lalu tuliskan kode programnya.
   contoh