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

[JASS] 3D Model on UI

Status
Not open for further replies.
Level 20
Joined
Jul 12, 2010
Messages
1,719
ok guys so I saw this thread and I tried to make a 3D model on UI with no luck...

Code:
local framehandle model = BlzCreateFrameByType("SPRITE", "Test", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)

//    call BlzFrameSetModel(model, "units\\human\\ArthaswithSword\\ArthaswithSword", 0)
    call BlzFrameSetModel(model, "ui\\feedback\\xpbar\\xpbarconsole.mdx", 0)

//    call BlzFrameSetTexture(model, "Textures\\Arthas.blp" , 1, true)

//    call BlzFrameSetSpriteAnimate(model, 1, 0)

    call BlzFrameSetSize(model, 0.2, 0.2)
    call BlzFrameSetAbsPoint(model, FRAMEPOINT_CENTER, 0.4, 0.4)

endfunction

//===========================================================================
function InitTrig_model_3d takes nothing returns nothing
    set gg_trg_model_3d = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_model_3d, 0.50 )
    call TriggerAddAction( gg_trg_model_3d, function Trig_model_3d_2_Actions )
endfunction

Does anybody know how to do it without the whole screen turning black?

Also why does this method require special 2d models? o_O

If anybody knows please provide a working example, thank you.
 

Attachments

  • 3d model.w3m
    8 KB · Views: 43
Unit models are huge, to have them fit on the screen one has to scale them down to a small fraction. In Reforge Beta they are displayed in not black mode.

Lua:
TimerStart(CreateTimer(), 0, false, function()
    print("Start")   
    local parent = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0)
    local spriteFrame = BlzCreateFrameByType("SPRITE", "", parent, "", 0)
    BlzFrameSetModel(spriteFrame, "units\\human\\Footman\\Footman.mdx", 0)
    BlzFrameSetSize(spriteFrame, 0.001, 0.001)
    BlzFrameSetScale(spriteFrame, 0.002)
    BlzFrameSetAbsPoint(spriteFrame, FRAMEPOINT_CENTER, 0.4, 0.3)
    print("Done")
end)
 
Status
Not open for further replies.
Top