This file contains 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 * | |
from math import * | |
tex = pyglet.image.load('biosphere.png').get_texture() | |
step = 10 | |
vlists = [] | |
for lat in range(-90,90,step): | |
verts = [] |
This file contains 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
# | |
# Receive hand & finger data from "LeapSample.py" via UDP and render it in 2D | |
# | |
from pyglet.gl import * | |
# Create a UDP socket to receive the data | |
import socket | |
insock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
# Listen to port 5000 | |
insock.bind(('',5000)) |
This file contains 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class QuitOnEsc : MonoBehaviour | |
{ | |
void Start() | |
{ | |
} |
This file contains 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 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 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
# circle.py | |
# by Dave Pape, for DMS 423 | |
# | |
# draws a circle, where the points for the vertex list are computed at run-time | |
from math import * | |
from pyglet.gl import * | |
window = pyglet.window.Window() |
This file contains 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
/* | |
Create Unity mesh data for a sphere, which can be used with a video (or still) texture from a 360-camera. | |
The mesh is created so that it will be visible when the viewer is inside, rather than outside, of the sphere, with Unity's default backface-culling mode. | |
Texture coordinates are based on latitude & longitude (ie an equirectangular map projection) which matches the images from the 360-cameras that we use. | |
*/ | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class LatLonSphere : MonoBehaviour |
This file contains 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
/* | |
Visualize data from SEDAC's Gridded Population of the World data set - https://sedac.ciesin.columbia.edu/data/set/gpw-v4-population-count-rev11 | |
Parses the population counts and converts the data into a greyscale texture. | |
The data file must be in ASCII format, with its extension changed to ".txt" in order for Unity to recognize it as a TextAsset. | |
*/ | |
using System.Collections; | |
using System.Collections.Generic; | |
using System; | |
using UnityEngine; |
NewerOlder