• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Camera rotation instead of scrolling

Status
Not open for further replies.
Level 4
Joined
Nov 13, 2019
Messages
47
Is there a way to rotate the camera when the cursor approaches the left or right side of the screen instead of scrolling?

In my case it would be static over a battlefield. Would be nice to get different angles.
 
If the main camera is as you said static then it's really easy to achieve by making two regions on both sides, and two cameras at your preferred angle. Then you track the mouse position and save the mouse cursor position to a temporary location. Have a periodic trigger that checks if the temporary location is within the battlefield regions, and if it is, you apply the correct cameras. Once the temp location is no longer within the side regions you pan back to the original camera.
 
Level 4
Joined
Nov 13, 2019
Messages
47
If the main camera is as you said static then it's really easy to achieve by making two regions on both sides, and two cameras at your preferred angle. Then you track the mouse position and save the mouse cursor position to a temporary location. Have a periodic trigger that checks if the temporary location is within the battlefield regions, and if it is, you apply the correct cameras. Once the temp location is no longer within the side regions you pan back to the original camera.
Ill try that out thanks. But if I apply other cameras i.e. 90 degrees from the original, wouldn't that result in only two angles? I was hoping of having all the angles in between too. Is it possible to rotate the main camera incrementally as long as your mouse is within the "scroll region"? Also, as the camera rotates wouldn't regions have to follow somehow?
 
Level 9
Joined
Jul 30, 2018
Messages
445

Well, that actually doesn't have a function to change the edge panning. (Although it might have some other features to satisfy OP :p)

I don't think there's a function for tracking the mouse position, but you could make a periodic trigger that checks where the target of the camera is. If it moves to certain direction, you could then set the target location back to where it should be then instead roll the camera. (Oh, this was already proposed..)

You could also add an invisible unit to the middle of the map and lock the camera to that unit and follow its facing and work on from that. With my system, for example, there's a built-in feature to use the arrow keys, but the edge panning could be a bit trickier nevertheless.
 
Last edited:
Status
Not open for further replies.
Top