Monday, May 17, 2010

How to install openGL to get graphics


You qill want something called "freeglut", this tut is for windows:
- Download freeglut 2.6.0 and glut 3.7 packages.
- Extract the files to a temp folder.
- If you are using Visual Studio then locate each of the below files in the extracts and,
  • Put freeglut.h in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL\’ (note: you'll have to create the GL folder)
  • Put freeglut_ext.h in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL\’
  • Put freeglut_std.h in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL\’
  • Put freeglut.lib in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\’
  • Put freeglut.dll in: ‘C:\WINDOWS\system32\’ (SysWOW64 folder for vista or win7 64 bit users)
  • Put glut32.dll in: ‘C:\WINDOWS\system32\’ (SysWOW64 folder for vista or win7 64 bit users)
  • Put glut32.lib in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\lib\’
  • Put glut.h in: ‘C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL\’
- Also in Visual Studio you will have to go to project proporties Linker > Input > additional dependancies and add "opengl32.lib glu32.lib glut32.lib" without quotes. Also you will need to add the lib and includes that you just added. let me know if you have difficulty. http://tempvariable.blogspot.com/2008/02/installing-freeglut-on-visual-studio.html is another good site.

The easiest way if you don't use visual studio is to just put the .h and .lib files in the same folder as your source code and put the .dlls in the same folder as compiled .exe file. Then at the top of your code just have #include "freeglut.h".

Heres some stuff you can make. Posted above is a frame from my nbod x,y,z system simulation. Each quadrant of the graphic shows a different angle.

Josh,

No comments:

Post a Comment