The Sims 3 Hint and Cheat

Sunday 30 December 2012


The Sims 3 Hint and Cheat


  • tekan CTRL SHIFT C dl, terus ketik  "testingcheatsenabled true" . setelah selesei.  pergi ke mailbox di depan rumah anda. lalu kursor di mailbox dan klik kanan + tekan SHIFT . pilih option FINISH. energi kalian akan penuh terus,
  • testingcheatsenabled true : untuk mmbuat semua cheat berguna. setelah itu pergi ke mailbox depan rumah kamu . klik + SHIFT . akan muncul banyak option cheat agar keluargamu hidup terus dan bahagia haha #halah
  • motherlode : 50.000$
  • familyfunds [nama kluarga] [duek] contoh "familyfunds kanata 9999999"  : agar uangnya 99999999 / suka2 kalian masukinnya berapa. yang jelas harus di atas 50rb dong. biar g sama dengan motherlode. tapi bila ada nama kluarga yang sama dengan keluargamu. maka mreka semua juga ikut2an mempunyai uang yang sama dengan yang kamu kketikkan tersebut.



1. Pizza Tanpa Basi
Cara : Telefon pengantar pizza, jangan terima pizzanya. maka si pengantar lama kelamaan bakalan pergi gan meninggalkan pizza pesanan kita di pekarangan depan,dan pizza itu tidak akan basi. telefon pengantar pizza sebanyak mungkin, kalo sims kamu lapar tinggal ambil di depan :D
2. Mendapat Mobil Polisi
Cara : Setelah mengaktifkan testingcheatsenabled true lalu pijit SHIFT klik ke mailbox lalu set career, klik law enforcement, jadi spy, kamu akan mendapat mobil polisi. Setelah itu kamu bisa quit job J
3. Bayi Kembar
Cara : Setelah mengaktifkan tstingcheatsenabled true lalu aktifkan(klik) sims kamu yang sedang hamil tekan CTRL SHIFT C lalu ketik forcetwins
4. Cara Cepat Tumbuh
Cara : beli kue ulang tahun, lalu suruh sims yang ikin kamu naikan umurnya untuk blow out candles di kue tersebut.
5. Cara Mudah Membersihkan Piring Cucian
Cara : Drag piring yang akan di cuci ke inventory sims kamu, masuk ke inventory sims kamu drag cucian ke kolom sell.
6. Menentukan Jenis Kelamin Bayi
Cara : Untuk mendapat bayi laki-laki : makanlah banyak Apel
Untuk mendapat bayi perempuan : makanlah banyak Semangka
Untuk mendapat bayi kembar : salah satu atau kedua orangtua harus memiliki lifetime reward Fertility Treatment.
7. Cara Mudah Membuat Teman
Cara : 1. Jika kemampuan gitar mu sudah mencapai 5 lebih , pergi ke taman, lalu play for tips disana, setiap orang yang menonton akan meningkatkan pertemanan.
2. *hanya berlaku untuk anak kecil* pergi ke taman lalu klik ke sims lain pilih play tag, klik ke sims lain untuk join tag, semakin lama bermain pertemanan akan bertambah J
8. Mengubah Nama Simsmu
Cara : Pergi ke City Hall, lalu pilih change name pada pukul 8 am – 9 pm, hari senin – jum’at.
9. Mempunyai Anak Hantu (tanpa membunuhnya)
Cara : Sims kamu harus memiliki sifat kleptomaniacs (sims kamu harus perempuan)
1. Pergi ke kuburan.
2. Tunggu sampai sims kamu mencuri makam(harus makam laki-laki)
3. Kalau sudah tercuri pulang, lalu simpan makam di rumah, maka dalam beberapa hari hantu akan muncul pada jam 11 pm – 4 am.
4. Teruslah berinteraksi dengan hantu.
5. Jika sudah mempunyai tingkat pertemanan yang tinggi, ajak hantu tersebut try for baby.
6. Maka bayi yang lahir adalah hantu J
10. Simsmu Tidak akan Mati
Cara : 1. Simpanlah Death Flower di inventory simsmu, maka saat grim reaper datang dia akan mentrade nyawamu dengan death flower . cara untuk mendapatkannya : pergi ke Pleasant Rest Graveyard, di dekat gerbang ada pohon Death Flower Bush, petik bunganya :)
2. Makanlah life fruit, maka umurmu akan berkurang.
Death Flower dan Life Fruit bisa di dapat dari bijinya atau dengan Cheat buydebug
11. Mendapat Hidden Object
Cara : setelah mengaktifkan testingcheatsenabled true , tekan CTRL SHIFT C lalu ketik buydebug tekan enter, masuk ke buy mode, klik tab ke 2 . maka akan ada kolom baru dengan lambang ?.
12. Menonton Vidiomu Di The Sims 3
Cara : Simpan Vidio yang kamu inginkan ke folder "/My Documents/EA Games/The Sims 3/Movies/Broadcast/[television station]" . nyalakan Tvmu dan tonton :). Vidionya harus .AVI dengan resolusi kurang ato sama dengan 128x128 pixels, dan frame rate kurang dari 15 frame/second.
13. Dengarkan Lagumu Di The Sims 3
Cara : Simpan lagumu di folder "/My Documents/EA Games/The Sims 3/Music/[radio station]" . Nyalakan The Sims, pergi ke Options, pilih music settings pilih radio station. Pilih lagu yang ingin di mainkan.
14. Beli dan Jual tanpa Mengurangi uang
Cara : Kalau misalkan simsmu miskin beli barang dan jual pada hari yang sama maka uangmu tidak akan berkurang. Tapi jika membeli sekarang di jual esoknya harga jualnya akan berkurang .
Mis: kamu butuh alat olahraga, beli dan gunakan, pada saat selesai segera jual, jika butuh lagi tinggal beli lg :D
15. Cheat testingcheatsenabled true
Mailbox
"Make All Happy"
"Make Friends For Me"
"Make Needs Static" or "Make Needs Dynamic"
"Make Me Know Everyone"
"Force Visitor"
Various "Force NPC" options
Various "Set Career" options
Work place
"Force Opportunity"
"Force Event"
"Force All Events"
Ground
"Build/Buy on this lot" (requires v1.7)
"Teleport"
Any Sim
"Add To Active Household/Family"
"Trigger Age Transition"
Active Sim
"Modify Traits for Active Sim"
Non-household Sim
"Add to Household"
Any object
"Object... Delete It" (requires v1.7)



  • ini dia ku kasih link objek untuk download RAMBUT,BAJU / SEGALA ITEM THE SIMS FREE . tapi perlu kalian ketahui. untuk link 2 kalian harus register dulu agar bisa download dengan free. ^_^ ,. cuma register apa susahnya sih bila kalian akna mendownload ratusan objek di sini :D  ^_^ 
  • >>> LINK 1 <<< 
  • >>> LINK 2 <<< NEWSEA


Mencegah kematian
  • Pergilah ke taman pemakaman umum. Di dekat pagar terdapat semak yang disebut dengan”Death Flower Bush” –> panenlah bunga tersebut dan simpan di inventory Sims anda –> ketika anda didatangai the Grim Reaper berikan bunga tersebut. intinya di setiap org dalam keluarga anda wajib memiliki 1 bunga ini dalam tasnya.
  • Meskipun bunga tersebut tidak akan bias muncul lagi, bila Sims anda telah mencapai Gardening Level 7, Sims anda akan dapat menanam “Unknown Special Seeds” ditemukan di pemakaman dan beberapa tempat yang mempunyai poensi sebagai tempat tumbuh untuk “Death Flower. Catatan: anda harus mempunyai salah satu Sims dengan pembawa sifat “the Green Thumb” untuk bisa menanam kembali “Death Flower”. Nah, bagi yang pingin panjang umur pake trik ini. :)
       Pakaian baru
  • Untuk mendapatkan pakaian baru dari dresser dari “Buy Options”–> klik “Plan Outfit”. Anda bisa membeli 3 dari tiap tipe pakaian (formal, every day, athletic, dll.).


referensi : http://sasoop.blogspot.com/2011/04/sims-3-hint-and-cheat.html

TUGAS JARMED Q 2

Monday 24 December 2012



Pengertian Karya Tulis

       Karya tulis mempunyai banyak ragam tergantung dari tujuan, manfaat, sumber penulisan, dan aspek-aspek lainnya. Berdasarkan sumbernya, secara umum karya tulis dapat diklasifikasikan menjadi dua yaitu karya fiksi (tidak ilmiah) dan non fiksi (ilmiah). Karya fiksi merupakan karya tulis yang sumbernya semata-mata imajinasi, fantasi, atau rekaan dari si penulis. Tujuan orang menulis fiksi biasanya untuk menghibur atau bisa jadi untuk mengungkapkan isi hati penulis. Karya sastra merefleksikan situasi masyarakat tertentu. Contoh dari karya tulis jenis ini adalah karya sastra: novel, cerpen, puisi, dan lain-lain.

Pengertian Karya Ilmiah

       Karya ilmiah (scientific paper) adalah laporan tertulis dan diterbitkan yang memaparkan hasil penelitian atau pengkajian yang telah dilakukan oleh seseorang atau sebuah tim dengan memenuhi kaidah dan etika keilmuan yang dikukuhkan dan ditaati oleh masyarakat keilmuan tertentu. Jenis-jenis karya ilmiah antara lain: karangan ilmiah, laporan penelitianmakalah atau paper, artikel, dan lain-lain. Barangkali anda sering mendapat tugas dari guru untuk membuat karangan, makalah, atau paper sewaktu menempuh pelajaran tertentu. Ini artinya anda sudah pernah membuat karya ilmiah.

sumber : http://belajarpsikologi.com/pendekatan-jenis-dan-metode-penelitian-pendidikan/

TUGASKU . : "what the hell is that" (bener2 g suka mengarang "wajib" >,<" ,. 




SISTEMATIKA PENULISAN KARYA ILMIAH 


Sistematika dari penulisan karya ilmiah terdiri dari beberapa bagian sebagai berikut: 

JUDUL
ABSTRAK
LEMBAR PERSETUJUAN 
KATA PENGANTAR 
DAFTAR ISI
DAFTAR LAMPIRAN 
DAFTAR TABEL
BABI.  PENDAHULUAN 

  • A.   Latar Belakang Masalah  
  • B.   Perumusan Masalah
  • C.  Tujuan dan Manfaat Penulisan  
    •  1. Tujuan Penulisan
    • 2.  Manfaat Penulisan 

BAB II.  KAJIAN TEORETIS DAN METODOLOGI PENULISAN 

  • A.  Kajian Teoretis
  • B. Kerangka Berpikir
  • C.  Metodologi Penulisan 

BAB III.  PEMBAHASAN (judul sesuai topik masalah yang dibahas) 

  • A.  Deskripsi Kasus
  • B.  Analisis Kasus 

BAB IV  KESIMPULAN 

  • A.  Kesimpulan 
  • B.  Saran 

DAFTAR PUSTAKA
LAMPIRAN-LAMPIRAN (termasuk sinopsis gambaran umum perusahaan yang ditulis)

TUGAS GRAFKOM Q 7 (cara membuat tic tac toe OPENGL)

Thursday 20 December 2012


keterangan : 

pakek openGL microsoft visual c++ 2010 express.

source code



from link http://www.openglprojects.in/


#include <GL/glut.h>  // glut (gl utility toolkit) basic windows functions, keyboard, mouse.
#include <stdio.h>    // standard (I/O library)
#include <stdlib.h>   // standard library (set of standard C functions
#include <math.h>     // Math library (Higher math functions )
#include <string.h>

// lighting
GLfloat LightAmbient[]= { 0.5f, 0.5f, 0.5f, 1.0f };
GLfloat LightDiffuse[]= { 0.5f, 0.5f, 0.5f, 1.0f };
GLfloat LightPosition[]= { 5.0f, 25.0f, 5.0f, 1.0f };
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };

// mouse variables: Win = windows size, mouse = mouse position
int mouse_x, mouse_y, Win_x, Win_y, object_select;

// state variables for Orho/Perspective view, lighting on/off
static int view_state = 0, light_state = 0;

// Use to spin X's and O's
int spin, spinboxes;

// Win = 1 player wins, -1 computer wins, 2 tie.
// player or computer; 1 = X, -1 = O
// start_game indicates that game is in play.
int player, computer, win, start_game;


// alingment of boxes in which one can win
// We have 8 posiblities, 3 accross, 3 down and 2 diagnally
//
// 0 | 1 | 2
// 3 | 4 | 5
// 6 | 7 | 8
//
// row, colunm, diagnal information

static int box[8][3] = {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {0, 3, 6},
                {1, 4, 7}, {2, 5, 8}, {0, 4, 8}, {2, 4, 6}};

// Storage for our game board
// 1 = X's, -1 = O's, 0 = open space

int box_map[9];
// center x,y location for each box
int object_map[9][2] = {{-6,6},{0,6},{6,6},{-6,0},{0,0},{6,0},{-6,-6},{0,-6},{6,-6}};

// quadric pointer for build our X
GLUquadricObj *Cylinder;

// Begin game routine
void init_game(void)
{
int i;

// Clear map for new game
for( i = 0; i < 9; i++)
{
box_map[i] = 0;
    }

// Set 0 for no winner
win = 0;
start_game = 1;
}


// Check for three in a row/colunm/diagnal
// returns 1 if there is a winner
int check_move( void )
{

int i, t = 0;

//Check for three in a row
for( i = 0; i < 8; i++)
{
    t = box_map[box[i][0]] + box_map[box[i][1]] + box_map[box[i][2]];
if ( (t == 3) || ( t == -3) )
         {
          spinboxes = i;
          return( 1 );
         }
    }
t = 0;
// check for tie
for( i = 0; i < 8; i++)
{
    t = t + abs(box_map[box[i][0]]) + abs( box_map[box[i][1]]) + abs( box_map[box[i][2]]);
    }

if ( t == 24 ) return( 2 );

return( 0 );
}

// Do we need to block other player?
int blocking_win(void)
{
int i, t;
for( i = 0; i < 8; i++)
{
    t = box_map[box[i][0]] + box_map[box[i][1]] + box_map[box[i][2]];
if ( (t == 2) || ( t == -2) )
  {
  // Find empty
  if (box_map[box[i][0]] == 0) box_map[box[i][0]] = computer;
  if (box_map[box[i][1]] == 0) box_map[box[i][1]] = computer;
  if (box_map[box[i][2]] == 0) box_map[box[i][2]] = computer;
       return( 1 );
       }
    }
return( 0 );
}

// check for a free space in corner
int check_corner(void)
{
int i;

if ( box_map[0] == 0)
{
box_map[0] = computer;
i = 1;
return( 1 );
    }

if ( box_map[2] == 0)
{
box_map[2] = computer;
i = 1;
return( 1 );
    }

if ( box_map[6] == 0)
{
box_map[6] = computer;
i = 1;
return( 1 );
    }

if ( box_map[8] == 0)
{
box_map[8] = computer;
i = 1;
return( 1 );
    }

return( 0 );
}

// Check for free space in row
int check_row(void)
{

if ( box_map[4] == 0)
{
box_map[4] = computer;
return( 1 );
    }

if ( box_map[1] == 0)
{
box_map[1] = computer;
return( 1 );
    }

if ( box_map[3] == 0)
{
box_map[3] = computer;
return( 1 );
    }
if ( box_map[5] == 0)
{
box_map[5] = computer;
return( 1 );
    }
if ( box_map[7] == 0)
{
box_map[7] = computer;
return( 1 );
    }
 
return( 0 );
}

// logic for computer's turn
int computer_move()
{
if ( blocking_win() == 1) return( 1 );
if ( check_corner() == 1) return( 1 );
if ( check_row() == 1) return( 1 );

return( 0 );
}

// I use this to put text on the screen
void Sprint( int x, int y, char *st)
{
int l,i;

l=strlen( st ); // see how many characters are in text string.
glRasterPos2i( x, y); // location to start printing text
for( i=0; i < l; i++)  // loop until i is greater then l
{
glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, st[i]); // Print a character on the screen
}

}


// This creates the spinning of the cube.
static void TimeEvent(int te)
{

    spin++;  // increase cube rotation by 1
if (spin > 360) spin = 0; // if over 360 degress, start back at zero.
glutPostRedisplay();  // Update screen with new rotation data
glutTimerFunc( 10, TimeEvent, 1);  // Reset our timmer.
}


// Setup our Opengl world, called once at startup.
void init(void)
{
   glClearColor (1.0, 1.0, 1.0, 0.0);  // When screen cleared, use black.
   glShadeModel (GL_SMOOTH);  // How the object color will be rendered smooth or flat
   glEnable(GL_DEPTH_TEST);   // Check depth when rendering
   // Lighting is added to scene
   glLightfv(GL_LIGHT1 ,GL_AMBIENT, LightAmbient);
   glLightfv(GL_LIGHT1 ,GL_DIFFUSE, LightDiffuse);
   glLightfv(GL_LIGHT1 ,GL_POSITION, LightPosition);
   glEnable(GL_LIGHTING);  // Turn on lighting
   glEnable(GL_LIGHT1);    // Turn on light 1

   start_game = 0;
   win = 0;

   // Create a new quadric
   Cylinder = gluNewQuadric();
   gluQuadricDrawStyle( Cylinder, GLU_FILL );
   gluQuadricNormals( Cylinder, GLU_SMOOTH );
   gluQuadricOrientation( Cylinder, GLU_OUTSIDE );
}


void Draw_O(int x, int y, int z, int a)
{

glPushMatrix();
glTranslatef(x, y, z);
glRotatef(a, 1, 0, 0);
glutSolidTorus(0.5, 2.0, 8, 16);
glPopMatrix();

}


void Draw_X(int x, int y, int z, int a)
{

glPushMatrix();
glTranslatef(x, y, z);
glPushMatrix();
glRotatef(a, 1, 0, 0);
glRotatef(90, 0, 1, 0);
glRotatef(45, 1, 0, 0);
glTranslatef( 0, 0, -3);
gluCylinder( Cylinder, 0.5, 0.5, 6, 16, 16);
//glutSolidCone( 2.5, 3.0, 16, 8 );
glPopMatrix();
glPushMatrix();
glRotatef(a, 1, 0, 0);
glRotatef(90, 0, 1, 0);
glRotatef(315, 1, 0, 0);
glTranslatef( 0, 0, -3);
gluCylinder( Cylinder, 0.5, 0.5, 6, 16, 16);
//glutSolidCone( 2.5, 3.0, 16, 8 );
glPopMatrix();
glPopMatrix();

}

// Draw our world
void display(void)
{
int ix, iy;
int i;
int j;

glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);  //Clear the screen

glMatrixMode (GL_PROJECTION);  // Tell opengl that we are doing project matrix work
glLoadIdentity();  // Clear the matrix
glOrtho(-9.0, 9.0, -9.0, 9.0, 0.0, 30.0);  // Setup an Ortho view
glMatrixMode(GL_MODELVIEW);  // Tell opengl that we are doing model matrix work. (drawing)
glLoadIdentity(); // Clear the model matrix

glDisable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
glColor3f(0.0, 0.0, 1.0);

if ( start_game == 0 )
   {
   Sprint(-2, 0, "Tic Tac Toe");
   Sprint(-3, -1, "To Start press");
   Sprint(-3, -2, "right button for X's");
   Sprint(-3, -3, "and left for O's");
   }

if (win == 1) Sprint( -2, 1, "You win");
if (win == -1) Sprint( -2, 1, "Computer win");
if (win == 2) Sprint( -2, 1, "Tie");

// Setup view, and print view state on screen
if (view_state == 1)
{
    glColor3f( 0.0, 0.0, 1.0);
    Sprint(-3, 8, "Perspective view");
    glMatrixMode (GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(60, 1, 1, 30);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    }else
{
glColor3f( 0.0, 0.0, 1.0);
    Sprint(-2, 8, "Ortho view");
    }

// Lighting on/off
if (light_state == 1)
{
glDisable(GL_LIGHTING);
    glDisable(GL_COLOR_MATERIAL);
    }else
{
    glEnable(GL_LIGHTING);
    glEnable(GL_COLOR_MATERIAL);
    }


gluLookAt( 0, 0, 20, 0, 0, 0, 0, 1, 0);


// Draw Grid
for( ix = 0; ix < 4; ix++)
{
       glPushMatrix();
       glColor3f(1,1,1);
  glBegin(GL_LINES);
  glVertex2i(-9 , -9 + ix * 6);
  glVertex2i(9 , -9 + ix * 6 );
  glEnd();
  glPopMatrix();
}
for( iy = 0; iy < 4; iy++ )
  {
       glPushMatrix();
       glColor3f(1,1,1);
  glBegin(GL_LINES);
  glVertex2i(-9 + iy * 6, 9 );
  glVertex2i(-9 + iy * 6, -9 );
  glEnd();
  glPopMatrix();
  }

glColorMaterial(GL_FRONT, GL_AMBIENT);
glColor4f(0.5, 0.5, 0.5, 1.0);
glColorMaterial(GL_FRONT, GL_EMISSION);
glColor4f(0.0, 0.0, 0.0, 1.0 );
glColorMaterial(GL_FRONT, GL_SPECULAR);
glColor4f(0.35, 0.35, 0.35, 1.0);
glColorMaterial(GL_FRONT, GL_DIFFUSE);
glColor4f(0.69, 0.69, 0.69, 1.0);
//glDisable(GL_COLOR_MATERIAL);
glColor3f( 1.0, 0.0, 1.0);  // Cube color
//glEnable(GL_COLOR_MATERIAL);
// Draw object in box's

for( i = 0; i < 9; i++)
   {
   j = 0;
   if (abs( win ) == 1 )
      {
      if ( (i == box[spinboxes][0]) || (i == box[spinboxes][1]) || (i == box[spinboxes][2]))
         {
          j = spin;
          }else j = 0;
        }
   if(box_map[i] == 1) Draw_X( object_map[i][0], object_map[i][1], -1, j);

   if(box_map[i] == -1) Draw_O( object_map[i][0], object_map[i][1], -1, j);
   }

//glDisable(GL_COLOR_MATERIAL);

glutSwapBuffers();
}

// This is called when the window has been resized.
void reshape (int w, int h)
{
   Win_x = w;
   Win_y = h;
   glViewport (0, 0, (GLsizei) w, (GLsizei) h);
   glMatrixMode (GL_PROJECTION);
   glLoadIdentity ();
}


// Read the keyboard
void keyboard (unsigned char key, int x, int y)
{
   switch (key)
   {

 case 'v':
 case 'V':
 view_state = abs(view_state -1);
 break;
 case 'l':
 case 'L':
 light_state = abs(light_state -1);
 break;
   case 27:
         exit(0); // exit program when [ESC] key presseed
         break;
      default:
         break;
   }


}
void play_x()
{
//select=1;
player = 1;
  computer = -1;
  init_game();
}
void play_y()
{
player = -1;
      computer = 1;
 init_game();
 computer_move();
}


void mouse(int button, int state, int x, int y)
{
// We convert windows mouse coords to out openGL coords
mouse_x =  (18 * (float) ((float)x/(float)Win_x))/6;
mouse_y =  (18 * (float) ((float)y/(float)Win_y))/6;

// What square have they clicked in?
object_select = mouse_x + mouse_y * 3;

if ( start_game == 0)
{
    if ((button == GLUT_RIGHT_BUTTON) && (state == GLUT_DOWN))
      {
       player = 1;
  computer = -1;
  init_game();
  return;
      }

    if ((button == GLUT_LEFT_BUTTON) && (state == GLUT_DOWN))
      {
 player = -1;
      computer = 1;
 init_game();
 computer_move();
 return;
      }
   }

if ( start_game == 1)
{
    if ((button == GLUT_LEFT_BUTTON) && (state == GLUT_DOWN))
      {
      if (win == 0)
         {
         if (box_map[ object_select ] == 0)
            {
            box_map[ object_select ] = player;
       win = check_move();
       if (win == 1)
          {
          start_game = 0;
               return;
               }
              computer_move();
         win = check_move();
         if (win == 1)
            {
                  win = -1;
                  start_game = 0;
                  }
              }
            }
 }
   }

if ( win == 2 )start_game = 0;

}
void options(int id)
{
 switch(id)
 {

  case 1:
 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
 play_x();
 break;
  case 2:
 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
     play_y();
      break;
  case 3:
 exit(0);
 }
}

// Main program
int main(int argc, char** argv)
{
   glutInit(&argc, argv);
   glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
   glutInitWindowSize (500, 500);
   glutInitWindowPosition (10, 10);
   glutCreateWindow (argv[0]);
   glutSetWindowTitle("X's and O's 3D");
   init ();
   glutCreateMenu(options);
   glutAddMenuEntry("Play with X",1);
   glutAddMenuEntry("Play with O",2);
   glutAddMenuEntry("Quit",3);
   glutAttachMenu(GLUT_RIGHT_BUTTON);
   glutDisplayFunc(display);
   glutReshapeFunc(reshape);
   glutKeyboardFunc(keyboard);
   glutMouseFunc(mouse);
   glutTimerFunc( 10, TimeEvent, 1);
   glutMainLoop();
   return 0;
}



LOGO UB.

Monday 17 December 2012

biasaaaa,...~ nyimpen online~ ,,,.



SO SWEET ICONS XD

TUGAS JARMED Q

Friday 7 December 2012


TENTANG KOMPRESI VIDEO

SLIDE PPT


silahkan download di sini
PPT JARMED

TUGAS GRAFKOM Q 6



KOTAK BERGARIS

keterangan : 

pakek openGL microsoft visual c++ 2010 express.

source code


#include <windows.h>
#include <glut.h>

void dispaly(){
glColor3f(1.0,1.0,1.0); //warna putih
glBegin(GL_QUADS); //buat kotak
glVertex2f(100,100);
glVertex2f(100,300);
glVertex2f(400,300);
glVertex2f(400,100);
glEnd();

glColor3f(0.0,0.0,0.0);
glBegin(GL_LINES);
glVertex2f(100,100);
glVertex2f(100,300);

glVertex2f(100,300);
glVertex2f(400,300);

glVertex2f(400,300);
glVertex2f(400,100);

glVertex2f(100,100);
glVertex2f(400,100);

glVertex2f(125,100);
glVertex2f(125,300);

glVertex2f(225,100);
glVertex2f(225,300);

glVertex2f(275,100);
glVertex2f(275,300);

glVertex2f(150,100);
glVertex2f(150,300);

glVertex2f(175,100);
glVertex2f(175,300);

glVertex2f(200,100);
glVertex2f(200,300);

glVertex2f(250,100);
glVertex2f(250,300);

glVertex2f(300,100);
glVertex2f(300,300);

glVertex2f(325,100);
glVertex2f(325,300);

glVertex2f(350,100);
glVertex2f(350,300);

glVertex2f(375,100);
glVertex2f(375,300);
glEnd();

glFlush();
}

void init (){
GLfloat w=500, h=400;
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
glViewport(0,0,(GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//gluOrtho2D(w,0,h,0);
gluOrtho2D(0,w,0,h);
glMatrixMode(GL_MODELVIEW);
}

void FnKey (unsigned char key, int x, int y) {
if (key==27)
{
//glutLeaveGmeMode(); set the revolution how it was
exit(1); //quit the program
}
}

int main(int argc, char** argv){
FreeConsole();
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);

//to full screen
/*glutGameModeString( "1024x768:32@75");
glutEnterGameMode();*/

glutInitWindowSize (600,500);
glutInitWindowPosition (100,100);
//glutCreateWindow (argv[0]);
glutCreateWindow ("Create Point");

init();
glutKeyboardFunc(FnKey);
glutDisplayFunc(dispaly);
//glutReshapeFunc(reshape);
glutMainLoop();
return 0;
}



TUGAS GRAFKOM Q 5



Bulat bergaris


keterangan : 
pakek openGL microsoft visual c++ 2010 express.


source code



#include <stdafx.h>
#include <glut.h>
#include <math.h>



void display()
{
glClear(GL_COLOR_BUFFER_BIT);

 float alpha, radius, cx, cy;
 cx=25;
 cy=25;
 alpha = 0;
 radius = 12;

 glBegin(GL_LINE_STRIP);
 {
  for(float i=0; i<=360; i++)
  {
   alpha+=1;
   glVertex2f(radius * cos (alpha/180 * 3.1415) + cx, radius * sin(alpha/180 * 3.1415) + cy);
  }

 }

 glEnd();


 glBegin(GL_LINES);
glVertex2f(14,20);
glVertex2f(14,30);

glVertex2f(15,18);
glVertex2f(15,32);

glVertex2f(16,17);
glVertex2f(16,33);

glVertex2f(17,16);
glVertex2f(17,34);

glVertex2f(18,15);
glVertex2f(18,35);

glVertex2f(19,14);
glVertex2f(19,35);
//------------------------
glVertex2f(20,14);
glVertex2f(20,36);

glVertex2f(21,14);
glVertex2f(21,36);
//------------------------------
glVertex2f(22,13);
glVertex2f(22,37);

glVertex2f(23,13);
glVertex2f(23,37);

glVertex2f(24,13);
glVertex2f(24,37);

glVertex2f(25,13);
glVertex2f(25,37);

glVertex2f(26,13);
glVertex2f(26,37);

glVertex2f(27,13);
glVertex2f(27,37);

glVertex2f(28,13);
glVertex2f(28,37);

glVertex2f(29,14);
glVertex2f(29,36);
//------------------------------
glVertex2f(30,14);
glVertex2f(30,36);

glVertex2f(31,14);
glVertex2f(31,36);

glVertex2f(32,15);
glVertex2f(32,35);

glVertex2f(33,16);
glVertex2f(33,34);

glVertex2f(34,17);
glVertex2f(34,33);

glVertex2f(35,18);
glVertex2f(35,32);

glVertex2f(36,20);
glVertex2f(36,30);
//------------------------------
 glEnd();

 glFlush();
}
void myinit()
{
 glMatrixMode(GL_PROJECTION);
 glLoadIdentity();
 gluOrtho2D(0.0, 50.0, 0.0, 50.0);
 glMatrixMode(GL_MODELVIEW);
 glClearColor(1.0,1.0,1.0,1.0);
 glColor3f(0.0,0.0,0.0);
}

int main(int argc, char* argv[])
{
 glutInit(&argc,argv);
 glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
 glutInitWindowSize(400,400);
 glutInitWindowPosition(50,50);
 glutCreateWindow("testing1");
 glutDisplayFunc(display);
 myinit();
 glutMainLoop();

 return 0;
}


TUGAS GRAFKOM Q 4

PERSEGI 4 


keterangan : 

pakek openGL microsoft visual c++ 2010 express.


source code


#include <Windows.h>
#include <math.h>
#include <gl/glut.h>

void display(){
glColor3f(1.0,1.0,1.0);

//bentuk setengah oval asli
glPushMatrix();
glTranslated(-90,0,0);
glLineWidth(5);
glBegin(GL_POLYGON);
for(float theta=0; theta<=180; theta++){
GLfloat radt = (theta/180)*(3.14);
glVertex2f(radt*50, sin(radt)*100+200);
}
glEnd();
glPopMatrix();

//bentuk setengal oval, diputar 90 derajat ke kiri
glPushMatrix();
glRotated(90,0,0,1);
glTranslated(45,-110,0);
glLineWidth(5);
glBegin(GL_POLYGON);
for(float theta=0; theta<=180; theta++){
GLfloat radt = (theta/180)*(3.14);
glVertex2f(radt*50, sin(radt)*100+200);
}
glEnd();
glPopMatrix();

//bentuk setengal oval, diputar 180 derajat ke kiri
glPushMatrix();
glRotated(180,0,0,1);
glTranslated(-68,-246,0);
glLineWidth(5);
glBegin(GL_POLYGON);
for(float theta=0; theta<=180; theta++){
GLfloat radt = (theta/180)*(3.14);
glVertex2f(radt*50, sin(radt)*100+200);
}
glEnd();
glPopMatrix();

//bentuk setengal oval, diputar 270 derajat ke kiri
glPushMatrix();
glRotated(270,0,0,1);
glTranslated(-200,-133,0);
glLineWidth(5);
glBegin(GL_POLYGON);
for(float theta=0; theta<=180; theta++){
GLfloat radt = (theta/180)*(3.14);
glVertex2f(radt*50, sin(radt)*100+200);
}
glEnd();
glPopMatrix();

//bentuk persegi untuk mengisi bagian tengah
glColor3f(0.0,0.0,1.0);
glPopMatrix();
glTranslated(-90,40,0);
glBegin(GL_POLYGON);
glVertex2f(0,0);
glVertex2f(0,160);
glVertex2f(160,160);
glVertex2f(160,0);
glEnd();
glPushMatrix();

glFlush();
}

void init(){
GLfloat w=1024, h=600;
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
glViewport(0,0,(GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(-500,w,-300,h);
glMatrixMode(GL_MODELVIEW);
}

void FnKey (unsigned char key, int x, int y) {
if (key==27){
exit(1);
}
}

int main(int argc, char** argv){
FreeConsole();
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);

glutInitWindowSize (768, 450);
glutInitWindowPosition (100, 100);

glutCreateWindow ("Create Circle");

init ();
glutKeyboardFunc(FnKey);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}


TUGAS GRAFKOM Q 3



 KINCIR ANGIN

keterangan : 

pakek openGL microsoft visual c++ 2010 express.
kincir angin ini bisa di control dengan meng klik tombol di keyboard

tombol d : muter ke kiri.
tombol s : muter ke kanan..

source code

#include <glut.h>
#include <stdlib.h>

static GLfloat spin = 0.0;

void init(void)
{
   glClearColor (1.1, 1.1, 1.1, 1.1);
   glShadeModel (GL_FLAT);
}

void display(void)
{
   glClear(GL_COLOR_BUFFER_BIT); // pembuatan  tiang
   glPushMatrix();
    glColor3f(1.0, 0.0, 1.0);
   glRectf(-8.0, -50.0, 8.0, 10.0);
   glPopMatrix();


   glPushMatrix(); // pembuatan baling 1
   glRotatef(spin, 0.0, 0.0, 1.0);
   glColor3f(0.0, 0.0, 1.0); //pembuatan baling 1 warna biru
   glRectf(-5.0, -30.0, 5.0, 30.0);

   glColor3f(0.0, 1.0, 0.0); //pembuatan baling 2 hijau
   glRectf(-30.0, -5.0, 30.0, 5.0);
   glPopMatrix();
   glutSwapBuffers();
}

void spinDisplay(void)
{
   spin = spin + 0.3;
   if (spin > 360.0)
      spin = spin - 360.0;
   glutPostRedisplay();
}
void spinDisplay2(void)
{
   spin = spin - 0.3;
   if (spin > 360.0)
      spin = spin - 360.0;
   glutPostRedisplay();
}
void reshape(int w, int h)
{
   glViewport (0, 0, (GLsizei) w, (GLsizei) h);
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
   glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
}

void keyboard (unsigned char key, int x, int y)
{
   switch (key) {
      case 'd':
         glutIdleFunc(spinDisplay);
         break;
      case 's':
         glutIdleFunc(spinDisplay2);
         break;
   }
}
/*void keyboard (unsigned char key, int x, int y)
{
   switch (key) {
      case 'd':
         day = (day + 10) % 360;
         glutPostRedisplay();
         break;
      case 'D':
         day = (day - 10) % 360;
         glutPostRedisplay();
         break;
      case 'y':
         year = (year + 5) % 360;
         glutPostRedisplay();
         break;
      case 'Y':
         year = (year - 5) % 360;
         glutPostRedisplay();
         break;
      default:
         break;
   }
}*/

/*
 *  Request double buffer display mode.
 *  Register mouse input callback functions
 */
int main(int argc, char** argv)
{
   glutInit(&argc, argv);
   glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);
   glutInitWindowSize (500, 500);
   glutInitWindowPosition (100, 100);
   glutCreateWindow (argv[0]);
   init ();
   glutDisplayFunc(display);
   glutReshapeFunc(reshape);
   glutKeyboardFunc(keyboard);
   glutMainLoop();
   return 0;
}


TUGAS GRAFKOM Q 2

membuat LAMPU HIDUP MATI, di tengah ruangan .
keterangan : 
pakek openGL microsoft visual c++ 2010 express.
lampu hidup mati bisa di control dengan meng klik tombol di keyboard

  • tombol R : nyala warna putih.
  • tombol G : nyala warna hijau.
  • tombol B : nyala warna  kuning.
  • tombol 0 : mati .
  • trus klo dilik kanan mouse. ruangan akan berputar ke kanan.
  • kalo di klik kiri . ruangan akan berputar ke atas.
source code 

#include <glut.h>
#include <math.h>

void cylinder(float rbase,float rtop,float height);
void blok(float tebal,int ratiol,int ratiop);
void bilah (float r_inner,float r_outer,float tebal,int batang);

int screen_width=800;
int screen_height=600;
int button_up=0,button_down=0;
int Turn=0;

double rotation_y=0,rotation_y_plus=-15,direction;
double Rhead=0,Rheadplus=0;
double rotate_All=0,All_plus=0;
double Angguk=0,Anggukplus=0;
double press=0,pressplus,pressplus1=180,pressplus2=0,pressplus3=0,pressplus4=0,pressplus5=0;

bool Toleh=true,Tolehpress=true;
bool RightTurn=true;
bool speed1=true,speed2=false,speed3=false,speed4=false,speed5=false;

//GLfloat ambient_light[]={0.3,0.3,0.45,1.0};
GLfloat ambient_light[]={0.0,0.0,0.45,1.0};
//GLfloat  source_light[]={0.9,0.8,0.8,1.0};
GLfloat  source_light[]={0.8,0.8,0.8,1.0};
//GLfloat     light_pos[]={7.0,0.0,1.0,1.0};
GLfloat     light_pos[]={5.0,0.0,6.0,1.0};

void init(void)
{
 glClearColor(1.0,1.0,1.0,0.0);  //putih
 //glClearColor(0.0,0.0,0.4,0.0); //back  biru 
 glShadeModel(GL_SMOOTH);
 glViewport(0,0,screen_width,screen_height);
 glMatrixMode(GL_PROJECTION);
 glLoadIdentity();
 gluPerspective(45.0f,(GLfloat)screen_width/(GLfloat)screen_height,1.0f,1000.0f);

 glEnable  (GL_DEPTH_TEST);
 glPolygonMode   (GL_FRONT_AND_BACK,GL_FILL);
 glEnable  (GL_LIGHTING);
 glLightModelfv  (GL_LIGHT_MODEL_AMBIENT,ambient_light);
 glLightfv  (GL_LIGHT0,GL_DIFFUSE,source_light);
 glLightfv  (GL_LIGHT0,GL_POSITION,light_pos);
 glEnable  (GL_LIGHT0);
 glEnable  (GL_COLOR_MATERIAL);
 glColorMaterial (GL_FRONT,GL_AMBIENT_AND_DIFFUSE);
}

void resize(int width,int height)
{
 screen_width=width;
 screen_height=height;

 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
 glViewport(0,0,screen_width,screen_height);
 glMatrixMode(GL_PROJECTION);
 glLoadIdentity();
 gluPerspective(45.0f,(GLfloat)screen_width/(GLfloat)screen_height,1.0f,1000.0f);

 glutPostRedisplay();
}

void display(void)
{
 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
 glMatrixMode(GL_MODELVIEW);
 glLoadIdentity();

 glTranslatef(0.0,-15,-70); //untuk menempatkan pada posisi yang tepat dengan sumbu (x, y, z)
 glPushMatrix();
   glRotatef(270,1.0,0.0,0.0); //untuk memutar objek agar sesuai dengan keinginan.
   rotate_All+=All_plus;
   glRotatef(rotate_All,0.0,0.0,1.0);
   cylinder(2.5,1.5,16);  //untuk membentuk model tabung.
   cylinder(2.5,2.5,6);
     glPushMatrix();
     glTranslatef(0.0,0.0,14);
  glRotatef(90,0.0,1.0,0.0);
  Angguk+=Anggukplus;
  glRotatef(Angguk,0.0,0.0,1.0);
        Anggukplus=0; 
    glPushMatrix();
    glRotatef(270,0.0,1.0,0.0);
    glTranslatef(0.0,0.0,1);
    cylinder(0.5,1,4);
    glPopMatrix();
  glutSolidTorus(1.5,2,6,16);
  glTranslatef(0.0,0.0,-2);
  cylinder(1,1,4.3);
  glTranslatef(0.0,0.0,2); //untuk menempatkan pada posisi yang tepat dengan sumbu (x, y, z)
  glRotatef(270,0.0,1.0,0.0);
       glPushMatrix();
       glTranslatef(0.0,0.0,10);
       glRotatef(90,1.0,0.0,0.0);
    //turn left-right for fan head  10/9/2003
    if ( Toleh==true)   
    {
     if(Turn >= 60)      // max degrees right
    RightTurn =false;
     if(Turn <=-60)   // max degrees left
    RightTurn =true;
     if(RightTurn == true )
     {
      Rheadplus++;
      Turn++;
     }
     else
     {
      Rheadplus--;
      Turn--;
     }
    }
       Rhead=Rhead+Rheadplus;
       glRotatef(Rhead,0.0,1.0,0.0);
    Rheadplus=0;
       // end turn left-right for fan head
    glTranslatef(0.0,0.0,-3.0);
       cylinder(4,4,6);
    cylinder(1,0.5,15);
    glRotatef(270,1.0,0.0,0.0);
    if(Tolehpress==true)  // press down turn left-right head button
     cylinder(0.3,0.5,6);
    else     // pull up turn left-right head button
     cylinder(0.3,0.5,7);
    glRotatef(90,1.0,0.0,0.0);
       glPushMatrix();
      glTranslatef(0.0,0.0,11);
      glutWireTorus(5,7,10,64);
      glutSolidTorus(0.5,12,10,64);
      rotation_y+=rotation_y_plus;
      if(rotation_y>359)rotation_y=0;
      glRotatef(rotation_y,0.0,0.0,1.0);
      bilah(3,10,3,5); // bilah(inner radius, outer radius, thickness, qty bilah)
       glPopMatrix();
     glPopMatrix();
   glPopMatrix();
   glRotatef(90,1.0,0.0,0.0);
   glTranslatef(0.0,-1.0,-4);
   blok(2,7,10);

   // speed selection   11/9/2003
   glTranslatef(-6,1,14);
   glRotatef(270,1.0,0.0,0.0);
   glTranslatef(2.0,0.0,0.0);
   glPushMatrix();
   glRotatef(pressplus5,1.0,0.0,0.0);
   blok(0.5,2,2);
   glPopMatrix();
   glTranslatef(2.0,0.0,0.0);
   glPushMatrix();
   glRotatef(pressplus1,1.0,0.0,0.0);
   blok(0.5,2,2);
   glPopMatrix();
   glTranslatef(2.0,0.0,0.0);
   glPushMatrix();
   glRotatef(pressplus2,1.0,0.0,0.0);
   blok(0.5,2,2);
   glPopMatrix();
   glTranslatef(2.0,0.0,0.0);
   glPushMatrix();
   glRotatef(pressplus3,1.0,0.0,0.0);
   blok(0.5,2,2);
   glPopMatrix();
   glTranslatef(2.0,0.0,0.0);
   glPushMatrix();
   glRotatef(pressplus4,1.0,0.0,0.0);
   blok(0.5,2,2);
   glPopMatrix();
   pressplus5=0;
   //end of speed selection
 glPopMatrix();

 glFlush();
 glutSwapBuffers();
}


void cylinder(float rbase,float rtop,float height) //untuk membentuk model tabung
{
 float i;
 glPushMatrix();
 glTranslatef(0.0,0.0,-rbase/4);
 glutSolidCone(rbase,0,32,4);
 for(i=0;i<=height;i+=rbase/8)
 {
  glTranslatef(0.0,0.0,rbase/8);
  glutSolidTorus(rbase/4,rbase-((i*(rbase-rtop))/height),16,16);
 }
 glTranslatef(0.0,0.0,rbase/4);
 glutSolidCone(rtop,0,32,4);
 glPopMatrix();
}

void bilah (float r_inner,float r_outer,float tebal,int batang)
{
 float i;
 glPushMatrix();
 glTranslatef(0.0,0.0,-tebal/4);
 cylinder(r_inner,r_inner,tebal);
 glTranslatef(0.0,0.0,tebal/2);
 glRotatef(90,0.0,1.0,0.0);
 for(i=0;i<batang;i++)
 {
  glTranslatef(0.0,0.0,r_inner);
  glRotatef(315,0.0,0.0,1.0);
  blok(0.5,r_inner*4.5,(r_outer-r_inner+(r_inner/4))*2);
  glRotatef(45,0.0,0.0,1.0);
  glTranslatef(0.0,0.0,-r_inner);
  glRotatef(360/batang,1.0,0.0,0.0);
 }
 glPopMatrix();
}

void blok(float tebal,int ratiol,int ratiop)
{
 float i,j;
 glPushMatrix();
 for(i=0;i<ratiop;i++)
 {
  glTranslatef(-(ratiol+1)*tebal/2,0.0,0.0);
  for(j=0;j<ratiol;j++)
  {
   glTranslatef(tebal,0.0,0.0);
   glutSolidCube(tebal);
  }
  glTranslatef(-(ratiol-1)*tebal/2,0.0,tebal);
 }
 glPopMatrix();
}

void keyboard_s(int key,int x,int y)
{
 if (rotation_y_plus !=0)
  direction=(rotation_y_plus/abs(rotation_y_plus));
 else
  direction=-1;
 switch(key)
 {
 case GLUT_KEY_UP:
  rotation_y_plus++;
  break;
 case GLUT_KEY_DOWN:
  rotation_y_plus--;
  break;
 case GLUT_KEY_END:
  rotation_y_plus=0;
  speed1=false;
  pressplus1=0;
  speed2=false;
  pressplus2=0;
  speed3=false;
  pressplus3=0;
  speed4=false;
  pressplus4=0;
  pressplus5=180;
  Toleh=false;
  break;
 case GLUT_KEY_F1:
  if(speed1 == false)
  {
   rotation_y_plus=15*direction;
   speed1=true;
   pressplus1=180;
   speed2=false;
   pressplus2=0;
   speed3=false;
   pressplus3=0;
   speed4=false;
   pressplus4=0;
   if(Tolehpress == true)
    Toleh=true;
  }
  else
  {
   speed1=false;
   pressplus1=0;
   rotation_y_plus=0;
   Toleh=false;
  }
  break;
 case GLUT_KEY_F2:
  if(speed2 == false)
  {
   rotation_y_plus=30*direction;
   speed1=false;
   pressplus1=0;
   speed2=true;
   pressplus2=180;
   speed3=false;
   pressplus3=0;
   speed4=false;
   pressplus4=0;
   if(Tolehpress == true)
    Toleh=true;
  }
  else
  {
   speed2=false;
   pressplus2=0;
   rotation_y_plus=0;
   Toleh=false;
  }
  break;
 case GLUT_KEY_F3:
  if(speed3 == false)
  {
   rotation_y_plus=45*direction;
   speed1=false;
   pressplus1=0;
   speed2=false;
   pressplus2=0;
   speed3=true;
   pressplus3=180;
   speed4=false;
   pressplus4=0;
   if(Tolehpress == true)
    Toleh=true;
  }
  else
  {
   speed3=false;
   pressplus3=0;
   rotation_y_plus=0;
   Toleh=false;
  }
  break;
 case GLUT_KEY_F4:
  if(speed4 == false)
  {
   rotation_y_plus=60*direction;
   speed1=false;
   pressplus1=0;
   speed2=false;
   pressplus2=0;
   speed3=false;
   pressplus3=0;
   speed4=true;
   pressplus4=180;
   if(Tolehpress == true)
    Toleh=true;
  }
  else
  {
   speed4=false;
   pressplus4=0;
   rotation_y_plus=0;
   Toleh=false;
  }
  break;
 case GLUT_KEY_F5:
  if(Tolehpress == false)
  {
   if(speed1==true||speed2==true||speed3==true||speed4==true)
    Toleh=true;
   Tolehpress=true;
  }
  else
  {
   if(speed1==true||speed2==true||speed3==true||speed4==true)
    Toleh=false;
   Tolehpress=false;
  }
  break;
 case GLUT_KEY_RIGHT:
  Rheadplus++;
  Turn++;
  break;
 case GLUT_KEY_LEFT:
  Rheadplus--;
  Turn--;
  break;
 case GLUT_KEY_PAGE_UP:
  Anggukplus--;
  break;
 case GLUT_KEY_PAGE_DOWN:
  Anggukplus++;
  break;
 }
}

void Mouse_s(int button, int state, int x, int y)
{
 if (state==0 && button==0)
  All_plus--;
 if (state==0 && button==2)
  All_plus++;
}


int main(int argc,char **argv)
{
 glutInit(&argc,argv);
 glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH);
 glutInitWindowSize(screen_width,screen_height);
 glutInitWindowPosition(0,0);
 glutCreateWindow("clear");
 glutDisplayFunc(display);
 glutIdleFunc(display);
 glutReshapeFunc(resize);
 glutSpecialFunc(keyboard_s);
 glutMouseFunc(Mouse_s);
 init();
 glutMainLoop();
 return(0);
}



TUGAS GRAFKOM Q

SEGITIGA biru .
pakek openGL microsoft visual c++ 2010 express.



#include <windows.h>
#include <glut.h>

void display(){
glColor3f(1.-60,0.-24,1.0);

glLineWidth(7);
glBegin(GL_LINES);
glVertex2f(100,100);
glVertex2f(210,300);

glVertex2f(210,300);
glVertex2f(320,100);
glVertex2f(100,100);
glVertex2f(320,100);
glEnd();

glFlush();
}

void init(){
glfloat w=500, h=400;
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
glViewport(0,0,(GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//gluOrtho2D(w,0,h,0);
gluOrtho2D(0,w,h,0);
glMatrixMode(GL_MODELVIEW);
}

void FnKey (unsigned char key, int x, int y){
if (key==30)
{
//glutLeaveGameMode(); //set the resolution how it was
exit(1);
}
}

int main(int argc, char** argv){
FreeConsole();
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);

//to full screen
/*glutGameModeString( "1366x768:32@60" );
glutEnterGameMode();*/

glutInitWindowSize (600,500);
glutInitWindowPosition (100,100);
//glutCreateWindow(argv[0]);
glutCreateWindow("Create Lines");

init ();
glutKeyboardFunc(FnKey);
glutDisplayFunc(display);
//glutReshapeFunc(reshape);
glutMainLoop();
return 0;
}


first.

RUmah dijual 3 Kamar Tidur dan Kolam Renang di Kota Malang - Graha Agung Residence

   HUNIAN RESORT DI TENGAH KOTA DENGAN KOLAM RENANG! KAWASAN PROPERTI TERBESAR DAN SATU-SATUNYA DI MALANG! GRAHA AGUNG RESIDENCE! jadi pilih...

 
FREE BLOGGER TEMPLATE BY DESIGNER BLOGS