Skip to content

Instantly share code, notes, and snippets.

@febret
febret / rotateSample
Last active December 19, 2015 00:29
omegalib node hierarchy and rotation example
from omega import *
from euclid import *
# needed for radians()
from math import *
a = SceneNode.create('a')
b = SceneNode.create('b')
a.addChild(b)
@febret
febret / omegaGetWand
Created June 28, 2013 16:31
Getting a wand position
# Example 1: Get wand position using the event function
onEvent():
e = getEvent()
if(e.getServiceType() == ServiceType.Wand())
wandPosition = e.getPosition()
# use wandPosition to do stuff here or save it in
# a global var and do stuf later
setEventFunction(onEvent)
@febret
febret / gist:6258665
Last active December 21, 2015 05:39
GamepadCameraController camera update
///////////////////////////////////////////////////////////////////////////////////////////////////
void GamepadCameraController::update(const UpdateContext& context)
{
if(!isEnabled()) return;
Camera* c = getCamera();
c->setOrientation(Math::quaternionFromEuler(Vector3f(myPitch, myYaw, 0)));
c->translate(mySpeedVector * context.dt, Node::TransformLocal);
}
@febret
febret / pickActor.py
Created August 23, 2013 01:58
Actor picking
# Actor dictionary
actors = {}
# create a custom actor class
class Pickable(Actor):
node = None
def __init__(self):
# create something
node = SphereNode.create(1,2)
node.setSelectable(True)
@febret
febret / oinputserver.cfg
Created August 14, 2014 20:01
lyra oinputserver cfg
config:
{
serverPort = "28000";
// VRPN Controller device for CalVR
vrpnTrackerName = "Navigation";
vrpnTrackerPort = 3894;
checkForDisconnectedClients = false;
@febret
febret / spin_navigation.py
Last active August 29, 2015 14:08
A small omegalib module for spinning/zooming a 3D model.
# Keys
# - Mouse Right button + movement rotates the model
# - Mouse wheel zooms in/out
# Use
# import spin_navigation
# spin_navigation.root = [root node that you want to manipulate]
from omega import *
from euclid import *
from math import *
@febret
febret / spinningCubeActor.py
Created December 29, 2014 02:25
Actor Basic Example
# This example creates a spinning cube every time the user right-clicks on the window.
# A custom Actor keeps track of each cube spinning.
from math import *
from euclid import *
from omega import *
from omegaToolkit import *
from cyclops import *
# The actor list is needed to avoid garbage-collecting alive actors.
actors = []
pointer:
{
type="cylindrical";
radius=3.238;
doorWidth = 36;
xBias = 0.0278;
minY = 0.305;
maxY = 2.625;
};
@febret
febret / oinputserver-cave2.cfg
Last active November 17, 2016 02:12
cave2 oinputserver cfg
config:
{
//serverListenIP = "127.0.0.1";
serverPort = "28000";
// VRPN Controller device for CalVR
vrpnTrackerName = "Navigation";
vrpnTrackerPort = 3894;
checkForDisconnectedClients = false;
@febret
febret / stereoTest.py
Created March 19, 2016 22:31
Stereo perception test
from cyclops import *
from random import *
from math import *
l = Light.create()
l.setPosition(0, 2, 0)
l.setAmbient(Color(0.5, 0.5, 0.5, 1))
s1 = SphereShape.create(0.5, 2)
s2 = SphereShape.create(0.5, 2)