I was a bit stumped when I stumbled into PowerVR's iPhone SDK for OGL ES 1.1. namely, I wasn't sure what PerspectiveFovRH was for... I messed around with the numbers a little, and discovered the relationship between PerspectiveFovRH and the usual glFrustum method:
glFrustum(frustumLeft, frustumRight, frustumBottom, frustumTop, frustumNear, frustumFar)
is the same as:
float fovy = 2 * atanf( (frustumTop - frustumBottom) / (2 * frustumNear) );
PerspectiveFovRH(fovy, 320/480, frustumNear, frustumFar, OGL, false);
COCOA: OpenGL View
I tried to render a box in OpenGL, and for some strange reason, the depth test wasn't working at all. Finally I googled the problem, and found out it was caused by the Interface Builder... this is why I avoid IB when developing...
Here's what the screen-capture looked like, even though I had enabled GL_DEPTH_TEST
basically you have to set the depth bit of the OpenGLView to be > 0 bit (which is default!?). While I was at it, I also changed the color to 32bit.
Here's what the screen-capture looked like, even though I had enabled GL_DEPTH_TEST
basically you have to set the depth bit of the OpenGLView to be > 0 bit (which is default!?). While I was at it, I also changed the color to 32bit.
Win32: Setting up OpenGL's GLUT
it's been a very long time since my previous posts. i had to recently install opengl on my windows xp environment, and found there were actually very little documentation on this subject. so here's a tutorial to getting things started in opengl & glut.
CHECK FOR OpenGL:
1. when you install visual studios, you should already have the following libraries and DLLs:
- OpenGL32.lib (in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib, etc)
- GLU32.lib (in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib, etc)
2. make sure you see the following dll's in C:\Windows\System32
- OpenGL32.dll
- GLU32.dll
BUILD & INSTALL GLUT:
1. goto http://www.opengl.org/resources/libraries/glut/glut_downloads.php
- i downloaded 3.7.6 from http://www.xmission.com/~nate/glut.html
- download glut-3.7.6-src.zip
2. unzip glut-3.7.6/ directory onto the desktop
3. open glut.dsw
4. build the glut32 project
if you have visual studios 6, you should be fine. however, if you have visual studio 9.0 like me, you'll end up with an error during file copy, so you have to do some manual copying and pasting...
1. inside the [[DESKTOP]]/glut-3.7.6/ directory navigate to:
- [[DESKTOP]]/glut-3.7.6/lib/glut/Debug
2. copy glut32.dll into C:\Windows\System32
3. Copy glut32.lib into C:\Program Files\Microsoft Visual Studio 9.0\VC\lib
4. Copy [[DESKTOP]]/glut-3.7.6/include/GL/glut.h to C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL\glut.h
after this you should be able to start compiling the samples from the OpenGL red book.
CHECK FOR OpenGL:
1. when you install visual studios, you should already have the following libraries and DLLs:
- OpenGL32.lib (in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib, etc)
- GLU32.lib (in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib, etc)
2. make sure you see the following dll's in C:\Windows\System32
- OpenGL32.dll
- GLU32.dll
BUILD & INSTALL GLUT:
1. goto http://www.opengl.org/resources/libraries/glut/glut_downloads.php
- i downloaded 3.7.6 from http://www.xmission.com/~nate/glut.html
- download glut-3.7.6-src.zip
2. unzip glut-3.7.6/ directory onto the desktop
3. open glut.dsw
4. build the glut32 project
if you have visual studios 6, you should be fine. however, if you have visual studio 9.0 like me, you'll end up with an error during file copy, so you have to do some manual copying and pasting...
1. inside the [[DESKTOP]]/glut-3.7.6/ directory navigate to:
- [[DESKTOP]]/glut-3.7.6/lib/glut/Debug
2. copy glut32.dll into C:\Windows\System32
3. Copy glut32.lib into C:\Program Files\Microsoft Visual Studio 9.0\VC\lib
4. Copy [[DESKTOP]]/glut-3.7.6/include/GL/glut.h to C:\Program Files\Microsoft Visual Studio 9.0\VC\include\GL\glut.h
after this you should be able to start compiling the samples from the OpenGL red book.
Subscribe to:
Posts (Atom)