This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, random, time, math | |
from pyglet.gl import * | |
window = pyglet.window.Window() | |
pos1 = [0,0] | |
pos2 = [-1, 0] | |
heading1 = 0 | |
heading2 = 90 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, random, time, math | |
from pyglet.gl import * | |
window = pyglet.window.Window(500,500) | |
pos1 = [0,0] | |
pos2 = [0, 0] | |
pos3 = [0, 0] | |
pos4 = [0, 0] | |
heading1 = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This program draws a moving "car" with rotating wheels | |
# It demonstrates the use of the glPushMatrix and glPopMatrix to | |
# create a hierarchy of transformations. | |
from pyglet.gl import * | |
window = pyglet.window.Window(500,500) | |
angle = 0 | |
carPosition = [100, 100, 0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyglet.gl import * | |
window = pyglet.window.Window(600,500) | |
class Triangle: | |
def __init__(self,x,y,dx,dy,rot): | |
self.posX = x | |
self.posY = y | |
self.dx = dx | |
self.dy = dy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from math import * | |
from pyglet.gl import * | |
window = pyglet.window.Window() | |
class Circle: | |
def __init__(self,radius,r,g,b,x=0,y=0): | |
self.r = r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from math import * | |
from pyglet.gl import * | |
window = pyglet.window.Window() | |
class Circle: | |
def __init__(self,radius,r,g,b,x=0,y=0): | |
self.r = r | |
self.g = g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, time, math, os, random | |
from pyglet.gl import * | |
window = pyglet.window.Window() | |
keyboard = pyglet.window.key.KeyStateHandler() | |
window.push_handlers(keyboard) | |
class TexturedSquare: | |
def __init__(self, width, height, xpos, ypos, texturefile): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, time, math, os, random | |
import Image | |
from pyglet.gl import * | |
window = pyglet.window.Window() | |
keyboard = pyglet.window.key.KeyStateHandler() | |
window.push_handlers(keyboard) | |
def loadTexture(filename): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from math import * | |
from pyglet.gl import * | |
window = pyglet.window.Window() | |
keyboard = pyglet.window.key.KeyStateHandler() | |
window.push_handlers(keyboard) | |
def makeCircle(numPoints): | |
verts = [0,0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, time, math, os, random | |
import Image | |
import urllib2, StringIO | |
from pyglet.gl import * | |
window = pyglet.window.Window() | |
keyboard = pyglet.window.key.KeyStateHandler() | |
window.push_handlers(keyboard) | |
def getImageFromURL(url): |