Wowhead.WebControls.ModelViewer

The ModelViewer allows you to create a 3D model wearing whatever item you want.

How to use it

Here is an example of what you can get with a very simple code.
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        Dictionary<int, int> items = new Dictionary<int, int>();
        items.Add(5, 56163);
        items.Add(21, 50987);
        
        modelViewer.DataSource = items;
        modelViewer.DataSlotField = "Key";
        modelViewer.DataIDField = "Value";
        modelViewer.DataBind();
    }
</script>
<wowhead:ModelViewer id="modelViewer" runat="server" Race="BloodElf" Gender="Female" />
The following html code will be rendered:
<object data="http://static.wowhead.com/modelviewer/ModelView.swf" width="290px" height="400px" type="application/x-shockwave-flash"> 
  <param value="high" name="quality" /> 
  <param value="transparent" name="wmode" /> 
  <param value="always" name="allowsscriptaccess" /> 
  <param value="false" name="menu" /> 
  <param value="model=bloodelffemale&amp;modelType=16&amp;contentPath=http://static.wowhead.com/modelviewer/&amp;blur=1&amp;equipList=5,56163,21,50987" name="flashvars" /> 
  <param movie="http://static.wowhead.com/modelviewer/modelviewer_scale.swf?4" /> 
</object> 

The values added in the dictionary are taken from the Xml feed for the item.
Key = /wowhead/item/inventorySlot/@id
Value = /wowhead/item/icon/@displayId

For example, http://www.wowhead.com/?item=37169&xml

<wowhead>
    <item id="37169">
        <name><![CDATA[War Mace of Unrequited Love]]></name>
        <level>200</level>
        <quality id="4">Epic</quality>
        <class id="2"><![CDATA[Weapons]]></class>
        <subclass id="4"><![CDATA[One-Handed Maces]]></subclass>
        <icon displayId="50987">INV_Mace_77</icon>
        <inventorySlot id="21">Main Hand</inventorySlot>
        <!-- Content removed for brevity -->
        <link>http://www.wowhead.com/?item=37169</link>
    </item>
</wowhead>

Available styling properties:

  • BackColor: accepts an html color, sets the background color. If not set, the background will be transparent.
  • Width: accepts an Unit value. If not set, the default value, 290px, will be used.
  • Height: accepts an Unit value. If not set, the default value, 400px, will be used.

Last edited Mar 21, 2009 at 6:57 PM by Kralizek, version 2

Comments

No comments yet.