2008/7/16 Gudmundur Gunnarsson <the...@ho...>:
> Hi
>
> I'm new to DirectPython and have been testing it for the last few days. I'm
> running into problems with d3d.setTransform where the rotation of a model
> around the axises is not happening in the order that I want. Looks like it's
> XZY or ZXY but I want YZX or YXZ, putting the Y-axis rotation first. Each
> setTransform overwrites the last one so I can't stack them up. Is there a
> way to change the order or circumvent this somehow?
>
> Also, I wanted roll the eye/camera but couldn't find out how to do it. I can
> put it somewhere and aim it somewhere but I can't seem to manipulate an
> up-vector or roll it somehow. Is there a way to do this?
>
> Thanks!
>
You should be able to combine matrix operations by using the
d3d.Matrix-class and then feeding the final result to the
d3d.setMatrix()-function. Basically d3d.setTransform() is just a quick
shortcut for these operations.
The same also applies to the camera. d3d.setView() does some matrix
operations and creates the view- and projection matrices. You can
create these two matrices manually and the set them using
d3d.setMatrix(). However, this might be little tricky if you are not
familiar with matrices as the C-support functions are not currently
exposed. You could use ctypes and call D3DXMatrixPerspectiveFovLH()
and friends from the DirectX support .dll, but it is not a very good
solution. Some of these matrix functions will be added for the next
version, which should be (hopefully) released during this summer.
--
Heikki Salo
|