Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

MDL editing: BillboardedLockZ turns model 90° clockwise, why?

Discussion in 'Modeling & Animation' started by EdwardElric, Nov 25, 2015.

  1. EdwardElric


    Jun 19, 2010
    Hi there!

    I created a simple model in "GMAX 1.2". A plane which is slightly inclined like that:
    To export the model from GMAX I use the script "DeX_0.186m.mcr". After MDL-editing (adding Textures, Materials & adjusting Bone) everything is fine (model looks downwards in Magos War3 Model Editor, world editor & in game). This is the MDL:
    View attachment spiky3b.mdl
    But when I add "BillboardedLockZ," to the Bone, the model looks leftwards in the world editor & in game (Magos still shows downwards in "(Unanimated)"). Here is the second model with the said change:
    View attachment spiky3a.mdl
    To convert the MDL to MDX I use "MDLX Converter 1.04" from Guesst & ProFeT.
    To show the difference in a screenshot:
    On the left is the second model ("spiky3a.mdl") & on the right is the first model ("spiky3b.mdl") when imported into world editor:
    What is the issue?
    Why does "BillboardedLockZ" turn this model 90° clockwise in world editor & in game?
    How can i fix it in the MDL (text-editing prefered)?

    Please help & explain...

    edit (2015_11_27):
    following information was all i found after exploring the WWW for 1 day for everything interesting in connection with "BillboardedLockZ":
    source: post #1 from "Born²Modificate": http://www.wc3c.net/showthread.php?t=93945

    source: post #4 from "Cookie": http://www.wc3c.net/showthread.php?t=19639

    source: post #1 from "Rao Dao Zao": http://www.wc3c.net/showthread.php?t=74397

    source: post #4 from "shadow1500": http://www.wc3c.net/showthread.php?t=87156

    edit (2015_11_27, a little later :wink:):
    I might have understood it now by myself after I PM-ed BlinkBoy & tried to describe the problem as accurately as possible. First thing I noticed was, that I never conciously realized that I rotate objects in Magos with every start by 90° to "correct" the coordinate system. I then asked myself why Magos used to show the coordinate system the way it is showing by default: X axis vertically, Y axis horizontically. Warcraft has X axis horizontically & Y axis vertically when using triggers like:
    Code (vJASS):
    native CreateUnit takes player id, integer unitid, real x, real y, real face returns unit
    native SetCameraPosition takes real x, real y returns nothing

    And then I finally came across a possible solution! In fact there were 2 questions:
    1. Why does Magos show the X axis from a vertical perspective by default?
    2. Why does Warcraft Editor show units facing to the east when you set their orientation to 0°?
    And these two questions led me to a new assumption:
    The MDL flag "BillboardedLockZ" locks the model to the camera in Warcraft editor & game by using a unit orientation of 270°!
    Practical relevance for process of model creation in GMAX for models planned with "BillboardedLockZ":
    The axis which faces to the camera is the positive X axis, so your model mustn't face to -Y (south), but +X (east)!
    (Compare first screenshot for GMAX axis.)

    degree direction
    90° north
    180° west
    270° south

    Here are three final screenshots I catched for proof:

    (Same coordinate system in magos & warcraft!) World editor showing original peasant unit (MDL has no "BilldboardedLockZ" by default):

    (Same coordinate system in magos & warcraft!) World editor showing sorceress unit with model "spiky3b.mdl" (MDL has no "BilldboardedLockZ"!):
    (Note: When the unit from this screenshot is orientated to 270°, it looks identical to the unit from the next screenshot with "BilldboardedLockZ".)

    (Same coordinate system in magos & warcraft!) World editor showing priest unit with model "spiky3a.mdl" (MDL with "BilldboardedLockZ"!):

    Can someone confirm this assumption to be true? BlinkBoy?
    Last edited: Nov 27, 2015