Dr Conrad B. Hart and Associates
Awards
Files
| File | Uploader | Date |
|---|---|---|
|
motion_blur.jpg
Motion Blur. Purrty. |
simonwittber | 2007/04/01 17:04 |
|
particles_2.jpg
Particles are now under my control. |
simonwittber | 2007/04/01 14:48 |
|
particles.jpg
Particles. |
simonwittber | 2007/04/01 13:44 |
|
drcbh-0.0.zip
Particle Test |
simonwittber | 2007/04/01 12:35 |
Diary Entries
PyOGRE
OpenGL Options?
I'd really like to use OpenGL2.0, what are my best options for this?
From what I can see, OpenGL-ctypes doesn't yet provide OpenGL2.0.
OpenGL light test
I'm having trouble with OpenGL lighting, and want to determing if its a driver problem, or a code problem. I had this same problem in the last pyweek too... Could any willing volunteers please run the below code, and tell me if they get a flat shaded or a lit sphere? In the attached screenshot, you can see that there is clearly no lighting effects happening... If anyone can tell me what I'm doing wrong, I'd appreciate the help...
#!/usr/bin/python2.5
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
def main():
pygame.display.set_mode((1024,768), DOUBLEBUF|OPENGL)
#GL Setup
glShadeModel(GL_SMOOTH)
glEnable(GL_DEPTH_TEST)
glDepthFunc(GL_LEQUAL)
glClearDepth(1.0)
#Viewport Setup
glViewport(0, 0, 1024, 768)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(45.0, 1024.0/768, 0.1, 100)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
#sphere setup
q = gluNewQuadric()
glFrontFace(GL_CCW)
gluQuadricTexture(q, GL_TRUE)
gluQuadricNormals(q, GLU_FLAT)
gluQuadricOrientation(q, GLU_OUTSIDE)
#lighting setup
glEnable(GL_LIGHTING)
glEnable(GL_LIGHT1)
glLightfv(GL_LIGHT1, GL_AMBIENT, (0.0, 0.0, 0.0, 1.0))
glLightfv(GL_LIGHT1, GL_DIFFUSE, (1.0, 1.0, 1.0, 1.0))
glLightfv(GL_LIGHT1, GL_SPECULAR, (1.0, 1.0, 1.0, 1.0))
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (1.0, 1.0, 1.0, 1.0))
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, (0.0, 0.0, 0.0, 1.0))
glEnable(GL_COLOR_MATERIAL)
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)
glLightfv(GL_LIGHT1, GL_POSITION, (0.0, 0.0, 0.0))
while True:
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
glTranslatef(0.0, -1.0, -5.0)
gluSphere(q, 1.0, 32, 32)
pygame.display.flip()
for event in pygame.event.get():
if event.type in (QUIT, KEYDOWN):
return
if __name__ == "__main__":
main()
Themes
My Past Pyweek Mistakes
The game wasn't fun. I focused on eye-candy, and gameplay suffered. Placed second overall, first in production.
Pyweek #2. CorsairI tried to build a MMO. Geez. Nuff said. The game might have done better if I had created a bigger universe (The server ran out of planets to allocate to new players, so most people got a black screen on startup). Didn't place at all.
Pyweek #3. No starter.Problems at work nuked my brain, and I only got as far as the basecode. I didn't finish an entry.
Pyweek #4.I work for myself now, so I can probably make time to compete. I'm also working alone, so perhaps I'll aim for something more achievable this time... or maybe not! :-)
Messing around at 3AM...
Just for laughs, I thought I'd build some spaceships. Here's the first one. It's not textured, unless someone wants to volunteer?
I like spaceships...
freighter.obj