Hi everyone,
I'm hoping an OpenGL/OS X Guru maybe able to help me out.
[code]
[/code]
Thanks a lot,
kjm
#! /usr/bin/env python FullScreen = 0; ################################################ # going to start with a simple rds.
############################################################### # import required libraries import sys import string
from Numeric import * from RandomArray import *
#################### # openGL libraries from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import *
############################################################### # Some misc paramaters
# define the ESC key ESCAPE = '\033'
############################################################### NUMDOTS = 1000;
x = random(NUMDOTS)*2-1; y = random(NUMDOTS)*2- 1;
# handle keypress event def Keyboard(*args): global window if args[0]==ESCAPE: sys.exit()
# define a reshape function, in case it's needed def Reshape(w,h): if h == 0: h = 1
def stereoproj(x,y): xl = x xr = x - 0.015 return xl,xr
def display(*args):
global x,y
# Calculate the disp. x array (xl,xr) = stereoproj(x,y);
"""print shape(xl2), shape(y2) Commented debugging code print "size of (xl) = ", shape((xl)) print shape((y)) """
xl = transpose([xl]) xr = transpose([xr]) yim = transpose([y])
#print "shape xl = ", shape(xl) #print "shape xr = ", shape(xr) #print "shape y = ", shape(yim)
#print "shape lim = ",shape(lim) #print "shape rim = ",shape(rim)
# enabling these features does not seem to accomplish what I want.
# draw (xl,y) on screen glColor3f(1.0,0.0,0.0) # red glVertexPointerd(lim) glEnableClientState( GL_VERTEX_ARRAY ) glDrawArrays( GL_POINTS, 0, len(lim)) glDisableClientState( GL_VERTEX_ARRAY ) #glFlush() #glutSwapBuffers
# draw (xr,y) on screen glColor3f(0.0,1.0,0.0) # green glVertexPointerd(rim) glEnableClientState( GL_VERTEX_ARRAY ) glDrawArrays( GL_POINTS, 0, len(rim)) glDisableClientState( GL_VERTEX_ARRAY ) glFlush() glutSwapBuffers()
def setup_viewport():
glMatrixMode( GL_PROJECTION ) glLoadIdentity()
if FullScreen == 1: glutFullScreen()
#glutIdleFunc(display) glutKeyboardFunc( Keyboard ) glutMainLoop()
print "Hold on to your butts" print "Hit ESC to exit."
# run the shit main()
====================================== The Vision Egg mailing list Archives: //www.freelists.org/archives/visionegg Website: http://www.visionegg.org/mailinglist.html