Model Display Template Help

Hey all, I am attempting to showcase models with the bge and glsl. I would like the camera to rotate around the object and zoom in and out. I have gotten the rotation down but I want to constrain the rotation so that the camera will only rotate to a maximum of 90 degrees up or down (in relation to the model). To clarify, I want to be able to rotate up to the top or bottom of the model and have the camera stop at the top or bottom instead of constantly rotate. I cannot find any information on how to limit the rotation.

For movement, I have created a large icosphere that is invisible and the camera is parented to this. Then I have added rotation movement to the sphere so that the camera rotates with it.

Long story short, how can I limit the rotation of the icosphere on the local x axis in the game engine?

Thanks,
Zach

Edit: I did find the thread further down that uses some kind of animation curves to achieve a similar effect and I tried it but when I rotate to the left or right and then rotate up or down, it resets the orientation to face the front before it rotates up or down…

This is pretty frustrating! LoL.

Here’s a .blend for what I have so far…

https://docs.google.com/open?id=0B70mPPzJ80t4MnJsSnhiQ0VSMlE

Um, so… Can no one help me with this? Please, I would very much appreciate it!

zach

Thanks! I appreciate the help!

As I stated before, I used animation curves to rotate the camera around the model but it isn’t working the way I thought it would. It may not be that hard for someone who knows what they are doing but for someone new to the game engine it is tough to find and make sense of the information out there.

i spent all day today reading up on the many posts and sites that seemed to have info on what I was looking to do, yet I could not make sense of most of it. In the end I had to take a template from someone else’s post and modify it for my purposes.

Even then I am stumped by what is going on with the bge. I have gotten to where I can click and drag to rotate around a model which is exactly what I want but this only works with the mouse. The program is intended to be used on a touchscreen computer with windows on it. If I use the mouse, it is fine but if I use the touch screen it no longer does the click and drag. Instead, I hold my finger on the screen to drag and the model rotates constantly instead of only as I am dragging my finger.

Any suggestions as to what this might be??

Thanks!

Thank you! I will try this and see how it works with the touch screen.

Zach

OK…I tried the MouseOrbiter demo from Monster and it is an awesome set up. I cannot, however find a way to change the way to rotate the camera. Currently the button to rotate the camera is the Middle Mouse Button and in order to use this with a touch screen computer, it needs to be set to the Left Mouse Button. I have looked through all of the python text files included and I can’t find where the mouse buttons are defined. Can anyone tell me where this is defined?

Thanks,
Zach