• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

Camera Issue

Status
Not open for further replies.
Hi to you all :p

I've got a problem in my camera... I have an elevated terrain (about 1445 height) and a cliff-border around it. The camera is locked to my unit. Theoretically, the camera height should be the same while my unit is on the flat part, but then it approaches the border the camera lowers considerably. See the picture:

60743d1247769079-camera-issue-imagem-camera.jpg


Notice that, in the second picture, you can't see the fog.

Is there a way to keep the camera at the same height, all the time?
Also, GetLocationZ( position of unit ) will return always the same value.

Thanks already!
Hossomi
 

Attachments

  • Imagem - Camera.jpg
    Imagem - Camera.jpg
    87.7 KB · Views: 111
  • Imagem - Camera View.JPG
    Imagem - Camera View.JPG
    114.7 KB · Views: 67
Last edited:
Level 7
Joined
May 6, 2008
Messages
284
you can always use trigger and cameras to make that kind of height with you wanna look your game, or make for X time to wacth the game with differ camera height with trigger
 
Level 11
Joined
Apr 6, 2008
Messages
760
GetLocationZ( position of unit ) will return always the same value

Maybe because your terrain is flat?

Its a hell too work with cameras in places like this, have the same problem with the camera in one place on my map (no soluction yet).

but you could try to GetLocationZ(Location(GetCameraTargetPositionX(),GetCameraTargetPositionY()) (YES LEAKS) and matching with the units
 
Level 11
Joined
Apr 6, 2008
Messages
760
When i moved around the camera only CameraEyePosistion did updates it values. so my conclution is that GetCameraEyePosistionX/Y/Z returns where acctuly the camera is.

JASS:
function CheckZ takes nothing returns nothing
    local real Ex
    local real Ey
    local real Ez
    local real Cx
    local real Cy
    local real Cz
    local real Ux = GetUnitX(PlayerHero[0])
    local real Uy = GetUnitY(PlayerHero[0])
    local real Uz
    
    call MoveLocation(Loc,Ux,Uy)
    set Uz = GetLocationZ(Loc)

    // I didnt have it like this in the screen shot, there did i set 'Ez' and 'Cz' with the natives (GetBlahblah). changed it too check LocationZ instead
    if GetLocalPlayer() == Player(0) then
        set Ex = GetCameraEyePositionX()
        set Ey = GetCameraEyePositionY()
        set Cx = GetCameraTargetPositionX()
        set Cy = GetCameraTargetPositionY()
    endif
    
    call MoveLocation(Loc,Ex,Ey)
    set Ez = GetLocationZ(Loc)
    
    call MoveLocation(Loc,Cx,Cy)
    set Cz = GetLocationZ(Loc)
    
    call ClearTextMessages()
    
    call BJDebugMsg("Ex: "+R2S(Ex))
    call BJDebugMsg("Ey: "+R2S(Ey))
    call BJDebugMsg("Ez: "+R2S(Ez))
    call BJDebugMsg("Cx: "+R2S(Cx))
    call BJDebugMsg("Cy: "+R2S(Cy))
    call BJDebugMsg("Cz: "+R2S(Cz))
    call BJDebugMsg("Ux: "+R2S(Ux))
    call BJDebugMsg("Uy: "+R2S(Uy))
    call BJDebugMsg("Uz: "+R2S(Uz))
endfunction

function AddCam takes nothing returns nothing
    call TimerStart(Time,0.05,true,function CheckZ)
    call LockCamera(Player(0))
endfunction

(Bad Picture, all values are allmost the same)

attachment.php
 

Attachments

  • CameraTest.jpg
    CameraTest.jpg
    90.5 KB · Views: 123
Status
Not open for further replies.
Top