Files
2026-01-27 14:48:17 +01:00

83 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>web3d_viewer</title>
</head>
<body>
<div id="app"></div>
<script src="/dist/build.js"></script>
</body>
<script type="module">
import { webgl_original } from './src/draw/webgl_drawVue.js';
const WGL = new webgl_original();
// var options = new Object();
var X = 960;
var Y = 540;
let options ={
_dimX : X,
_dimY: Y,
_fileName: "ProjectSlice.3dm",
_showGrid: true,
_showInfiniteGrid: false,
_isOrtographic: true,
_sourceDir: "./src/source/",
_modelsDir: "./src/source/models/",
_fileType: '3DM',
_showFrame: true,
_frameType: 2,
_frameLen: 150, //mm
_frameFat: 4, //mm
_approxIndex: 5,
}
console.log(options._sourceDir + options._fileName)
WGL.initcall(options);
document.getElementById("refre_slider").oninput = function() {
myFunction()
};
function myFunction() {
var val = document.getElementById("refre_slider").value //gets the oninput value
console.log(val)
WGL.refreshcall(1, val)
}
document.getElementById('btnRef').onclick = function() {
options._dimX= document.getElementById('dimX').value;
options._dimY = document.getElementById('dimY').value;
console.log(X);
console.log(Y);
console.log(options);
// const container = document.getElementById('WebGL-3mfExport');
// const child = document.getElementsByTagName('canvas');
// container.removeChild(child);
const element = document.getElementsByTagName("canvas");
element[0].remove();
WGL.initcall(options);
}
document.getElementById('btnResetCam').onclick = function() {
WGL.resetCamera();
}
document.getElementById('bt_camera').onclick = function() {
WGL.setCameraType();
}
document.getElementById('ck_print').onclick = function(){
var val = document.getElementById('ck_print').checked;
WGL.showPrintDirection(val);
}
</script>
<script src="src/draw/webgl_drawVue.js" type="module"></script>
</html>