Thread: Model tilting
View Single Post
10-23-13, 06:03 AM   #9
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Interesting thread. I have some model functions in my model viewer aswell.

Finding a function that allows tossing around with the cameraposition would be awesome. It would be enough if the cameraposition z-axis has a max of 180° (-90° till 90°). Thus you can look at a model from bottom to top.

model:SetRotation() will do the rest since it allows a 360° rotation of the model around its axis.

Important: Models only work when cached. The only way to display uncached models is by using SetDisplayInfo() on a playermodel type model. That's how NPCSCAN works. It checks for the model cache to determine if a rare mob model is found.

Model methods

OTHER
Model:ClearModel() - Removes the 3D model currently displayed
Model:HasCustomCamera() - This function is not yet documented

GET
Model:GetCameraDistance() - This function is not yet documented
Model:GetCameraFacing() - This function is not yet documented
Model:GetCameraPosition() - This function is not yet documented
Model:GetCameraTarget() - This function is not yet documented
Model:GetFacing() - Returns the model's current rotation setting
Model:GetModel() - Returns the model file currently displayed
Model:GetModelScale() - Returns the scale factor determining the size at which the 3D model appears
Model:GetPosition() - Returns the position of the 3D model within the frame
Model:GetWorldScale() - This function is not yet documented

SET
Model:SetCamera(index) - Sets the view angle on the model to a pre-defined camera location
Model:SetCameraDistance() - This function is not yet documented
Model:SetCameraFacing() - This function is not yet documented
Model:SetCameraPosition() - This function is not yet documented
Model:SetCameraTarget() - This function is not yet documented
Model:SetCustomCamera() - This function is not yet documented
Model:SetFacing(facing) - Sets the model's current rotation
Model:SetModel("filename") - Sets the model file to be displayed
Model:SetModelScale(scale) - Sets the scale factor determining the size at which the 3D model appears
Model:SetPosition(x, y, z) - Sets the position of the 3D model within the frame
Source: http://wowprogramming.com/docs/widgets/Model

PlayerModel model sub-methods

PlayerModel:GetDoBlend() - This function is not yet documented
PlayerModel:RefreshCamera() - This function is not yet documented
PlayerModel:RefreshUnit() - Updates the model's appearance to match that of its unit
PlayerModel:SetAnimation() - This function is not yet documented
PlayerModel:SetBarberShopAlternateForm() - This function is not yet documented
PlayerModel:SetCamDistanceScale() - This function is not yet documented
PlayerModel:SetCreature(creature) - Sets the model to display the 3D model of a specific creature
PlayerModel:SetCustomRace() - This function is not yet documented
PlayerModel:SetDisplayInfo() - This function is not yet documented
PlayerModel:SetDoBlend() - This function is not yet documented
PlayerModel:SetPortraitZoom() - This function is not yet documented
PlayerModel:SetRotation(facing) - Sets the model's current rotation by animating the model
PlayerModel:SetUnit("unit") - Sets the model to display the 3D model of a specific unit
Source: http://wowprogramming.com/docs/widgets/PlayerModel

For my purposes I could work with playermodel type models only since I could not rely on a model being cached. But I could not get a custom camera to work on it. But maybe I was missing sth who knows. Accoring to the docs a playermodel type model is a child of the model object and inherits all model functions, so custom camera should work.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-23-13 at 06:43 AM.
  Reply With Quote