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

[JASS] Camera Zoffset

Status
Not open for further replies.
Level 11
Joined
Apr 6, 2008
Messages
760
I have some problems seting up the camera correct for my map

i have these 2 variables for that

JASS:
real Zoffset = (GetLocationZ(Data.Loc)*zOffsetMultiplyer+GetUnitFlyHeight(Data[index].LockedTo)
real CameraEyeZ = GetCameraEyePositionZ()

Now the problem is that i want the camera to have the same height allways even if the terrain change(the same "height" as the unit have + Zoffset). I have a problem when the unit walking on flying platforms the camera go thru the platforms.

Edit: added 2 screenshots of the problem

Edit 2: Another problem is that GetLocationZ() return the height on the "platforms" and no on the acctual ground which is the problem in this case
 

Attachments

  • CameraProb1.jpg
    CameraProb1.jpg
    203.5 KB · Views: 94
  • CameraProb2.jpg
    CameraProb2.jpg
    226.4 KB · Views: 81
Level 16
Joined
Feb 22, 2006
Messages
960
hm I found this function: GetDestructableOccluderHeight try to use it on the platform found it in:
JASS:
function GetElevatorHeight takes destructable d returns integer
    local integer height

    set height = 1 + R2I(GetDestructableOccluderHeight(d) / bj_CLIFFHEIGHT)
    if (height < 1) or (height > 3) then
        set height = 1
    endif
    return height
endfunction

edit: oh ok this function GetDestructableOccluderHeight works... it returns the right height, tested it with a plattform now
 
Status
Not open for further replies.
Top