Libary for creating spatial space hierarchies
Project description
spatial-transform
Libary for creating spatial space hierarchies, like game engines and renderes would do, to have diffrent rotations, scale and positions which can also rely on their parent.
This package was created for my master thesis and only aims about integrety but not performance. For the most of the calculations the package PyGLM is used.
Install
pip install spatial-transform
Features
- Transforms as stackable in form of trees.
- Transforms reactor to attaching and detaching.
- Support Translation, Rotation and Scale.
- Includes a static class for euler angle conversions.
- Space is defined as: Y+ is Up and right handed like openGL
Examples
Create and stack transforms
import SpatialTransform as st
root = st.Transform('root')
child1 = st.Transform('child1')
root.append(child1)
Change properties
import SpatialTransform as st
root = st.Transform('root')
root.Position = (1,2,3)
root.SetEuler((0, 45, 0))
root.Scale = (10, 10, 10)
root.Forward = (1, 1, 1)
Read properties
import SpatialTransform as st
root = st.Transform('root')
print(root.Position)
print(root.Orientation)
print(root.Scale)
print(root.ForwardLocal)
print(root.ForwardWorld)
print(root.UpLocal)
print(root.UpWorld)
print(root.RightLocal)
print(root.RightWorld)
print(root.SpaceLocal)
print(root.SpaceWorld)
Convert between spaced
import SpatialTransform as st
root = st.Transform('root')
print(root.pointToWorld((1,1,1)))
print(root.directionToLocal((1,1,1)))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for spatial_transform-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 533db4e04dbd3afe4bdfec3f6ee542f8466c19ca5b7e807ab879a1205012f743 |
|
MD5 | 8a08411a1c6ffa6ef819c2bee665bd94 |
|
BLAKE2b-256 | 405a0a566b6133aad32d0cc3e9607e3c26cc3afa05cf748cbf253ae54fac6f8b |