FiftyTifty

3.3.5a (API 30300) - Display object on screen

For a renderer mod that's being developed, I need a way to tell which zone the player is in, and the only real way of doing that is to detect for a specific mesh being rendered on the screen. I've looked at other addons, and came up with the following:

    local frame = CreateFrame("Frame", nil, UIParent)
    frame:SetPoint("Center", 128, 0)
    frame:SetWidth(256)
    frame:SetHeight(256)
    frame:SetAlpha(1)
     
    local model = CreateFrame("PlayerModel", nil, frame)
    model:SetAllPoints(frame)
     
    function ModelBasics_UpdateModel()
        model:SetModel("Interface\Buttons\talktome.m2")
        model:SetRotation(math.rad(0))
        model:SetAlpha(1)
        model:SetCustomCamera(1)
        model:SetCameraDistance(1)
        local x, y, z = model:GetCameraPosition()
        model:SetCameraPosition(x, y, 0)
        model:SetPosition(0, 0, 0)
    end
     
    ModelBasics_UpdateModel()

 

Which displays the following model: yEB4gEz.jpg

For some reason, I can't change it's position by editing "model:SetPosition(0, 0, 0)". It just stays in that exact same place. Is there anything I can do to change the object being rendered, and to rotate, and move it?

Share this post


Link to post
Share on other sites