Last active
December 19, 2015 00:29
-
-
Save febret/5868764 to your computer and use it in GitHub Desktop.
omegalib node hierarchy and rotation example
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 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