• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Help with Camera

Status
Not open for further replies.
Level 14
Joined
Jul 26, 2008
Messages
1,009
Hi, I have a camera system in place that basically functions off of hitting up/down and left/right for rotation with 90 degree rotations for left/right and a -900 (down) and 2000 (up) distance limit.

I want the camera to point more upwards for the angle, but am not sure how to adjust it to do that. Any help is appreciated. I believe this is the part relevant to that. I'm a bit of a noob with angles and cameras.

JASS:
function Trig_PlayerCam_Func002A takes nothing returns nothing
 local integer id = GetPlayerId(GetEnumPlayer())+1
    if udg_HERO_FloatCam[id] == false then
        if udg_HERO_Ref2[id] != null then
            if GetLocalPlayer() == GetEnumPlayer() then //DO NOT REFERENCE NON-GLOBALS IN A LOCAL, so NO GetHeroPlayer(id)
                call PanCameraToTimed( GetUnitX(udg_HERO_Ref2[id]), GetUnitY(udg_HERO_Ref2[id]), 0.50 )
                call SetCameraField( CAMERA_FIELD_TARGET_DISTANCE, 500.00 + Distance[id], 0.50 )
                call SetCameraField( CAMERA_FIELD_ANGLE_OF_ATTACK, 320.00 + Angle[id], 0.50 )
                call SetCameraField( CAMERA_FIELD_ROTATION, GetUnitFacing(udg_HERO_Ref2[id]) + Rotation[id], 0.50 )
                call SetCameraField( CAMERA_FIELD_ZOFFSET, 200.00, 0.50 )
            endif
        endif
    endif
endfunction
 
Last edited:
If you are having problems with getting the angle you want or the appropriate fields, try making a camera in the editor. I do this quite often to just make sure I have the proper values. All you do is you open up the camera editor palette and then create a camera. Then you can just move around your camera the way you'd like and select "Set camera to current view". Then right click the camera in the palette and then select "properties" or whatever option gives you the camera's values.

Then you simply have to copy the values over into the trigger. However, some functions may use radians instead of degrees, so you may want to do a few tests first to make sure you are getting the correct values.

Good luck.
 
Status
Not open for further replies.
Top