Rauy wrote:
The camera in untransformed state faces along the negative z-axis so it is correct, that it sees the model.
Yes, my problem is that models in untransformed state face the opposite direction as cameras in untransformed state.
Let me try to clarify it with some code:
Code:
function transformable:advancexz(yangle, speed)
local rady = math.rad(yangle-90)
self.px = self.px + (speed * math.cos(rady))
self.pz = self.pz - (speed * math.sin(rady))
end
I have a model at 0,0,0 without any rotation and a camera at 0,0,20 also without any rotation.
If I apply that code to the model, it advances towards positive Z. That means that the untransformed model 'faces' towards positive Z.
Same happens with the camera. But the camera in untransformed state happens to be facing negative Z.
What that means is that I can't use the same code to control a model and a camera. That seems wrong.
Also, I think the -90 smells. Why not have everything facing towards positive X?