• 🏆 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!

Rotating a camera's target

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I would have thought this would be easy...but I can't figure it out. Here is what I want:

I want the player's camera to stay in the same position (above a tower) and rotate its target left or right based on a real variable (0-360 representing the angle that the camera will point). Think of it as a lighthouse that can shine in any direction but the camera cannot move away from the lighthouse.

Unfortunately, the camera actions don't appear to do this.

  • Camera - Pan camera for Player 7 (Green) to cameraPoint over 0.00 seconds
^^ will move the camera maintaining its current rotation. So if I pan the camera to the right...the camera will move off the lighthouse.

  • Camera - Set Player 7 (Green)'s camera Rotation to camera3RotationCurrent over 0.00 seconds
^^ will also move the camera, swinging around the target point of the camera. So if I set the angle of rotation to 180-degrees the camera will swing around and I'll be looking at the lighthouse itself.

What I want is an action that says: pan camera target, or lock orientation to (point). I feel people must have had this problem before. Is there any solution? I considered making a dummy unit and locking the camera's orientation to that unit. Is that the best there is?
 
Level 14
Joined
Aug 30, 2004
Messages
909
Wow, I really thought that did something else. Thanks so much! +rep

UPDATE:

Some oddities I've discovered: the rotation commands to not appear to be additive. For example:

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Camera - Apply Crystal Tower Camera <gen> for Player 1 (Red) over 0.00 seconds
      • Set rotate = 167.00
      • Camera - Rotate camera -10.00 degrees around (Position of Cannon Tower 0000 <gen>) for Player 1 (Red) over 2.00 seconds
      • Wait 3.00 game-time seconds
      • Camera - Rotate camera -10.00 degrees around (Position of Cannon Tower 0000 <gen>) for Player 1 (Red) over 2.00 seconds
      • Wait 3.00 game-time seconds
      • Camera - Rotate camera -10.00 degrees around (Position of Cannon Tower 0000 <gen>) for Player 1 (Red) over 2.00 seconds
      • Wait 3.00 game-time seconds
      • Camera - Rotate camera -10.00 degrees around (Position of Cannon Tower 0000 <gen>) for Player 1 (Red) over 2.00 seconds
This command starts right...the camera rotates 10 degrees to the right. But after the wait command it doesn't continue rotating another 10 degrees...but instead jumps off the target and appears to revert to the normal camera orientation and then rotates. In other words, rotating the camera 20 degrees works fine. But rotating it 10 degrees and then another 10 degrees does not.

I'll keep playing with it...but I really don't understand how this command works when issued more than once.
 
Last edited:
Status
Not open for further replies.
Top