Thread Tools Display Modes
04-04-10, 01:55 PM   #1
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Unit models

RAAAAH!!!!

I got nice 3d unitmodels(not portraits, not that close up face-only bull****, but really FULL models) but there's one problem: some units and mostly totems show up VERY VERY zoomed. This is because I use :SetCamera(1). Now if I use :SetCamera(2) I can get everything nicely on one zoom, but an other problem arises: you see the model from above and I have no idea how to change that.

Please help!
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
04-04-10, 04:07 PM   #2
BFSskepsis
Premium Member
 
BFSskepsis's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jun 2008
Posts: 39
Might be easier if you could tell us the addon
__________________
  Reply With Quote
04-04-10, 04:12 PM   #3
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by BFSskepsis View Post
Might be easier if you could tell us the addon
It's my own Lua code, for the next version of ncUI.
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
04-04-10, 04:46 PM   #4
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 154
_NPCScan's 3D visual for its targeting button had the same issue where certain units were zoomed way out of proportion or were positioned half-way off the frame. The only solution I could come up with was editing the camera views by hand. I used the model returned by Model:GetModel as a key in the table to get at X,Y,Z, and Scale arguments for Model:SetPosition and Model:SetModelScale.

Sadly, there's no way to control the pitch of the camera, so your totem issue might not be solvable. Perhaps you can use camera 1 and SetModelScale simultaneously? I'm not sure if that would help, though.

If you do decide to use SetModelScale however, it has some quirks. One is that calling it before the model has been read into memory will show the model with a scale of 1 while Model:GetModelScale returns your value. This unreleased version of _NPCScan.Button.lua shows a workaround I figured out that waits for the model's mesh to load before adjusting the camera.
  Reply With Quote
04-04-10, 05:44 PM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
http://www.wowwiki.com/Widget_API#Model

Take a look at
http://www.wowwiki.com/API_Model_SetFacing
http://www.wowwiki.com/API_Model_SetModelScale
http://www.wowwiki.com/API_Model_SetPosition
http://wowprogramming.com/docs/widge...el/SetRotation

more...
http://wowprogramming.com/docs/widgets/PlayerModel
__________________
| 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 : 04-04-10 at 05:49 PM.
  Reply With Quote
04-05-10, 01:05 AM   #6
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by Saiket View Post
_NPCScan's 3D visual for its targeting button had the same issue where certain units were zoomed way out of proportion or were positioned half-way off the frame. The only solution I could come up with was editing the camera views by hand. I used the model returned by Model:GetModel as a key in the table to get at X,Y,Z, and Scale arguments for Model:SetPosition and Model:SetModelScale.

Sadly, there's no way to control the pitch of the camera, so your totem issue might not be solvable. Perhaps you can use camera 1 and SetModelScale simultaneously? I'm not sure if that would help, though.

If you do decide to use SetModelScale however, it has some quirks. One is that calling it before the model has been read into memory will show the model with a scale of 1 while Model:GetModelScale returns your value. This unreleased version of _NPCScan.Button.lua shows a workaround I figured out that waits for the model's mesh to load before adjusting the camera.
Thanks, going to look at that. The totem issue is just the the extreme zoom, the pitch issue was an issue created by a possible solution
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
04-05-10, 02:34 AM   #7
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Ok, that works! I still have to make a huge DB over time containing all the exceptions, but yeah... Can't get around it, can I?

Another problem arises: If the character/mob targetting has some kind of "glow effect" (enchant, glow effect on shoulders, etc) the enchants gets buffed up in the model. And with buffed up I mean that a little beastslayer enchant turns into a red apocalypse. I think it's caused by using scale, any info on this?
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
04-05-10, 05:18 AM   #8
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Try adjusting http://wowprogramming.com/docs/widgets/Model/SetGlow but not sure if there is any GetGlow() to get the current value. You need to pass a number value. If there is no getglow you could use getmodelscale as an indicator.
__________________
| 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 : 04-05-10 at 05:47 AM.
  Reply With Quote
04-05-10, 09:21 AM   #9
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
ive been working on 3d models myself. The glow setting will adjust the glow effects for you. Any item or armor effects or spell effects can be adjusted via the glow setting.

Also note there is a pan and angle setting for the camera. Ill dig out the info on it when i find it agian lol. Im curious if what you were talking about on the scaling is the one problem i have... so i have animations and the position and all perfect at lest when you first load but the moment an animation fires your char size resets to some other scale.

Also note that yes the DB of adjustments is necessary, There are some things to think about though, ZMobDB keeps track as you go a long of new models and position settings, so did mazzle's 3d models. I have been studying both of those to get my method for doing them.

Ive noticed some of the get position functions and some garble i read that was hard to understand suggested that it is possible to do this without the database but you would have to do a whole lot more with the get positioning info and how it then reacts. In other words i think you would have to have the database already be able to see how all the various get positions for certain mobs vary then make category for all the mobs and rather then have a DB in the end you would have it to do a get position, it would recognize the position as being category blah blah blah and then adjust the angle/pan/zoom and all that accordingly.

anyhow the DB's are already mostly available via ZMobDB or Mazzle's 3d model code. You might be able to adjust either of those db's to match your model windows so you dont need to do so much running around and gathering of data yourself.

If you search for some threads i started about 3d models some of the links to some of the info i dug up are in the thread...
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 04-05-10 at 09:26 AM.
  Reply With Quote
04-05-10, 02:14 PM   #10
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Grimsim, I'm VERY interested in a way WITHOUT a database. I want to use these models for my unitframes. And I haven't looked at mazzle's code jet, but I didn't find a database in ZMobDB yet(am I blind?).

Also, could you give me a clear light what the range/scale is on :SetGlow()?

Thanks!
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
04-06-10, 03:34 AM   #11
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Maybe, if you could extract the modelsize (height/width) of the actual used model you could derivate the needed modelscale.
__________________
| 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 : 04-06-10 at 03:36 AM.
  Reply With Quote
04-06-10, 05:49 AM   #12
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by zork View Post
Maybe, if you could extract the modelsize (height/width) of the actual used model you could derivate the needed modelscale.
I'll do some research with some MPQ extractors, and how the save format .m2 works. If I can extract the sizes of those models into a file it's not that hard with a little perl to get a lua formatted database of all the scales.

If I succeed I will ofcourse release it on WoWInterface
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Unit models


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