Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Add mouse canvas controls to UI

Scott Petrovic664337935721
diff --git a/art-source/mouse-icons.afdesign b/art-source/mouse-icons.afdesign
new file mode 100644
index 0000000..3deb14f
Binary files /dev/null and b/art-source/mouse-icons.afdesign differ
diff --git a/src/index.html b/src/index.html
index 8d5fbb4..d561cd1 100644
--- a/src/index.html
+++ b/src/index.html
@@ -11,6 +11,22 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" />
+
+
+ <!-- Top toolbar with mouse controls -->
+ <div id="mouse-controls">
+
+ <div>
+ <span><img src="images/mouse-left.svg" height="35" width="35" style="vertical-align: middle;"/> Rotate (Left drag)</span>
+ </div>
+ <div>
+ <span><img src="images/mouse-right.svg" height="35" width="35" style="vertical-align: middle;"/> Pan (Right drag)</span>
+ </div>
+ <div>
+ <span><img src="images/mouse-middle.svg" height="35" width="35" style="vertical-align: middle;"/> Zoom (Middle scroll)</span>
+ </div>
+ </div>
+
<div id="tool-panel">
<!-- create a radio button group. There are two options. Move Skeleton, Rotate Mesh -->
<div id="tool-selection-group">
diff --git a/src/lib/processes/StepLoadModel.ts b/src/lib/processes/StepLoadModel.ts
index e449f31..84e829a 100644
--- a/src/lib/processes/StepLoadModel.ts
+++ b/src/lib/processes/StepLoadModel.ts
@@ -117,9 +117,7 @@ export class StepLoadModel extends EventTarget {
<div>Select existing models or upload your own.</div>
<ol>
<li>Only GLTF files can be loaded</li>
- <li>Models with multiple objects won't be rigged correct. I need to work on this.</li>
- <li>Mouse primary drag to move view</li>
- <li>Mouse context drag to pan view</li>
+ <li>Models with multiple objects won't be rigged correct. I need to work on this.</li>
<li>Debugging allows you to test odd material artifacts by using a 'Normal' material instead of what is included in the mesh</li>
</ol>`
}
diff --git a/src/styles.css b/src/styles.css
index dc867d8..49ab061 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -196,7 +196,7 @@ option {
height: fit-content;
background: #0b1822;
box-shadow: 1px 1px 8px 0px #000000bf;
- top: 20px;
+ top: 70px;
left: 20px;
bottom: 0;
border: 1px dotted #5b8792;
@@ -325,4 +325,18 @@ input[type="file"] {
.dropdown-content a:hover {background-color: #ddd;}
/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
- .show {display:block;}
\ No newline at end of file
+ .show {display:block;}
+
+ #mouse-controls {
+ position: fixed;
+ top: 10px;
+ left: 0;
+ right: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 24px;
+ padding: 0 8px;
+ height: 50px;
+ z-index: 100;
+}
\ No newline at end of file
diff --git a/static/images/mouse-left.svg b/static/images/mouse-left.svg
new file mode 100644
index 0000000..6a1077e
--- /dev/null
+++ b/static/images/mouse-left.svg
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="100%" height="100%" viewBox="0 0 556 556" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
+ <g id="Artboard1" transform="matrix(1.38793,0,0,1.38793,0,0)">
+ <rect x="0" y="0" width="400" height="400" style="fill:none;"/>
+ <g transform="matrix(0.720495,0,0,0.787017,-243.569,-1.49443)">
+ <rect x="478.563" y="67.14" width="81.341" height="115.39" style="fill:rgb(13,202,242);"/>
+ </g>
+ <g transform="matrix(1.0078,4.13284e-20,0,0.951691,-67.0824,-16.6038)">
+ <path d="M349.667,114.607L349.667,323.468C349.667,351.859 327.9,374.909 301.09,374.909L203.935,374.909C177.124,374.909 155.357,351.859 155.357,323.468L155.357,114.607C155.357,86.216 177.124,63.166 203.935,63.166L301.09,63.166C327.9,63.166 349.667,86.216 349.667,114.607Z" style="fill:none;stroke:white;stroke-width:25.18px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-243.569,10.6478)">
+ <path d="M462.258,194.522L734.05,194.522" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-260.861,10.6478)">
+ <path d="M584.534,51.059L584.534,189.074" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-206.702,10.6478)">
+ <path d="M584.534,51.059L584.534,189.074" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-234.846,15.5543)">
+ <path d="M552.428,458.26C552.428,488.527 570.587,485.5 586.477,485.5C602.367,485.5 625.067,486.257 625.067,459.774" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ </g>
+</svg>
diff --git a/static/images/mouse-middle.svg b/static/images/mouse-middle.svg
new file mode 100644
index 0000000..772126f
--- /dev/null
+++ b/static/images/mouse-middle.svg
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="100%" height="100%" viewBox="0 0 556 556" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
+ <g transform="matrix(1,0,0,1,-591.139,0)">
+ <g id="Artboard1" transform="matrix(1.38793,0,0,1.38793,591.139,0)">
+ <rect x="0" y="0" width="400" height="400" style="fill:none;"/>
+ <g transform="matrix(0.720495,0,0,0.787017,-179.19,-1.49443)">
+ <rect x="478.563" y="67.14" width="81.341" height="115.39" style="fill:rgb(13,202,242);"/>
+ </g>
+ <g transform="matrix(1.0078,4.13284e-20,0,0.951691,-57.7656,-16.6038)">
+ <path d="M349.667,114.607L349.667,323.468C349.667,351.859 327.9,374.909 301.09,374.909L203.935,374.909C177.124,374.909 155.357,351.859 155.357,323.468L155.357,114.607C155.357,86.216 177.124,63.166 203.935,63.166L301.09,63.166C327.9,63.166 349.667,86.216 349.667,114.607Z" style="fill:none;stroke:white;stroke-width:25.18px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-234.252,10.6478)">
+ <path d="M462.258,194.522L734.05,194.522" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-251.544,10.6478)">
+ <path d="M584.534,51.059L584.534,189.074" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-197.385,10.6478)">
+ <path d="M584.534,51.059L584.534,189.074" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-225.529,15.5543)">
+ <path d="M552.428,458.26C552.428,488.527 570.587,485.5 586.477,485.5C602.367,485.5 625.067,486.257 625.067,459.774" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/static/images/mouse-right.svg b/static/images/mouse-right.svg
new file mode 100644
index 0000000..9ce7c98
--- /dev/null
+++ b/static/images/mouse-right.svg
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="100%" height="100%" viewBox="0 0 556 556" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
+ <g transform="matrix(1,0,0,1,-1187.82,0)">
+ <g id="Artboard1" transform="matrix(1.38793,0,0,1.38793,1187.82,0)">
+ <rect x="0" y="0" width="400" height="400" style="fill:none;"/>
+ <g transform="matrix(0.720495,0,0,0.787017,-116.191,-1.49443)">
+ <rect x="478.563" y="67.14" width="81.341" height="115.39" style="fill:rgb(13,202,242);"/>
+ </g>
+ <g transform="matrix(1.0078,4.13284e-20,0,0.951691,-59.0965,-16.6038)">
+ <path d="M349.667,114.607L349.667,323.468C349.667,351.859 327.9,374.909 301.09,374.909L203.935,374.909C177.124,374.909 155.357,351.859 155.357,323.468L155.357,114.607C155.357,86.216 177.124,63.166 203.935,63.166L301.09,63.166C327.9,63.166 349.667,86.216 349.667,114.607Z" style="fill:none;stroke:white;stroke-width:25.18px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-235.583,10.6478)">
+ <path d="M462.258,194.522L734.05,194.522" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-252.875,10.6478)">
+ <path d="M584.534,51.059L584.534,189.074" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-198.716,10.6478)">
+ <path d="M584.534,51.059L584.534,189.074" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ <g transform="matrix(0.720495,0,0,0.720495,-226.86,15.5543)">
+ <path d="M552.428,458.26C552.428,488.527 570.587,485.5 586.477,485.5C602.367,485.5 625.067,486.257 625.067,459.774" style="fill:none;stroke:white;stroke-width:34.26px;"/>
+ </g>
+ </g>
+ </g>
+</svg>