i found a library called pyeuclid and it seems to do what i want in respect to 3D math. it contins a 3D vector class and a 4X4 matrix class capable of transformations like rotate,translate and scale.
matrix creation is simple, simply pass along the arguments and the matrix is created.
>>> m = Matrix4()
>>> m.translate(50,50,50)
Matrix4([ 1.00 0.00 0.00 50.00
0.00 1.00 0.00 50.00
0.00 0.00 1.00 50.00
0.00 0.00 0.00 1.00])
the lbrary comes with a 3D vector class, if i wanted to translate a 3D point with this matrix i would need to first create the vector class, like this.
>>> v = Vector3(100,200,300)
>>> v
Vector3(100.00, 200.00, 300.00)
>>> v.x
100
>>> v.y
200
>>> v.z
300
Now the Matrix4() class comes with a method to transform coordinates, and its used like so.
>>> m.transform(v)
Point3(150.00, 250.00, 350.00)
this is great, however, there is no perspective projection applied, the library comes with a method called Matrix4.new_perspective(fov_y, aspect, near, far). Thats where the problem lies, i have no idea how to use this function properly, (m.transform(vector3) doesent produce anything usable )the documentation doesent show how its used with vectors or other matrices, it says something about being 'equivalent to the OpenGL call gluPerspective.fov_y', but ive never used opengl so that wont help.
this is the module (from euclid import Vector3 , Matrix4)
what i dont want, is recomendtions for some game engine/visulization library, or something thats bent on drawing something to the screen, i just want to know if i can use this library to to turn 3D vector coordnates into 2D screen coordinates, and if not what library can i use???
so get in there and help out noob in distress! :-) thank you for your help.