52 lines
1.1 KiB
HTML
52 lines
1.1 KiB
HTML
<div id="model" style="max-width: 608px; max-height: 800px;"></div>
|
|
|
|
<script type="application/javascript" src="/js/viewer.min.js"></script>
|
|
<script type="application/javascript">
|
|
window.WH = {
|
|
//debug: console.log,
|
|
debug: () => { },
|
|
};
|
|
|
|
const charData = JSON.parse(`{{{data}}}`);
|
|
const races = {
|
|
1: "human",
|
|
2: "orc",
|
|
3: "dwarf",
|
|
4: "nightelf",
|
|
5: "scourge",
|
|
6: "tauren",
|
|
7: "gnome",
|
|
8: "troll",
|
|
10: "bloodelf",
|
|
11: "draenei",
|
|
};
|
|
const genders = ["male", "female"];
|
|
|
|
const charactermodel = {
|
|
type: ZamModelViewer.WOW,
|
|
contentPath: "/data/",
|
|
background: "background.png",
|
|
container: $("#model"),
|
|
hd: true,
|
|
aspect: 0.76,
|
|
charCustomization: {
|
|
race: charData.race,
|
|
gender: charData.gender,
|
|
options: charData.customizationOptions,
|
|
sheathMain: -1,
|
|
sheathOff: -1,
|
|
},
|
|
cls: charData.class,
|
|
items: charData.characterModelItems,
|
|
models: {
|
|
type: ZamModelViewer.Wow.Types.CHARACTER,
|
|
id: `${races[charData.race]}${genders[charData.gender]}`,
|
|
},
|
|
mount: {
|
|
type: ZamModelViewer.Wow.Types.NPC,
|
|
//id: 25280,
|
|
id: 0,
|
|
},
|
|
};
|
|
const viewer = new ZamModelViewer(charactermodel);
|
|
</script>
|