Skip to content

Instantly share code, notes, and snippets.

@febret
Last active December 19, 2015 00:29
Show Gist options
  • Save febret/5868764 to your computer and use it in GitHub Desktop.
Save febret/5868764 to your computer and use it in GitHub Desktop.
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)
# set position of a relative to b
b.setPosition(Vector3(0,1,0))
# set position of a: after this, world position of b will be (1,1,0)
a.setPosition(Vector3(1,0,0))
# apply 90 degrees yaw to a: b will rotate around a's center (1,0,0)
#
a.yaw(radians(90))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment