Thread Tools Display Modes
08-07-22, 12:58 AM   #1
maqjav
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Feb 2012
Posts: 60
Playing with models

Hello.

This is something i've been struggling with for a long time, and I don't know if maybe nowsdays there is a solution to the problem.

I'm trying to display models dinamically in a frame and I want the model to fit perfectly in the frame.

For example:

Lua Code:
  1. local model = CreateFrame("PlayerModel", "mxpplayermodel", UiParent)
  2. model:SetPoint("CENTER")
  3. model:SetSize(120, 120)
  4. model:SetCamera(1)
  5. model:SetDisplayInfo(89822)
  6. model:Show()

This will draw a human model that fits perfectly in the frame, however if I use the DisplayID 1698 that belongs to a gigant, it shows only a portion of its body.

I know I can change the camera distance scale to show it completely like this:

Lua Code:
  1. local model = CreateFrame("PlayerModel", "mxpplayermodel", UiParent)
  2. model:SetPoint("CENTER")
  3. model:SetSize(120, 120)
  4. model:SetCamera(1)
  5. model:SetCamDistanceScale(4)
  6. model:SetDisplayInfo(1698)
  7. model:Show()

However... I don't know which models will require a modification of the camera distance scale and I don't want to check one by one and do a personal database with that information. Is is possible to solve this problem using other methods? or is it possible to know the model's size before showing it so I can adjust its scale?

Thanks.

Last edited by maqjav : 08-07-22 at 03:06 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Playing with models

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off