furballphat
2002.05.23, 06:15 PM
I am currently writing an openGL 3D terrain viewer which will hopefully be turned into a game. Currently I have a large square filled with tiles of random height.
I have it set up so that with keyboard control you can rotate the camera on the x and y axis and translate on the y axis. No problems here. I then added in a feature to let you scroll along the map by moving the cursor to the screen edge (as seen in most RTS games).
My problem is that I have to rotate on the y and then translate to make the camera rotate and not the map, but that means the axis have changed and when I translate the map, it veers off in the wrong direction if the camera has been rotated away from the zero position.
I would appreciate any help, furballphat.
I have it set up so that with keyboard control you can rotate the camera on the x and y axis and translate on the y axis. No problems here. I then added in a feature to let you scroll along the map by moving the cursor to the screen edge (as seen in most RTS games).
My problem is that I have to rotate on the y and then translate to make the camera rotate and not the map, but that means the axis have changed and when I translate the map, it veers off in the wrong direction if the camera has been rotated away from the zero position.
I would appreciate any help, furballphat.