-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
162 lines (135 loc) · 4.8 KB
/
Copy pathtest.html
File metadata and controls
162 lines (135 loc) · 4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!DOCTYPE html>
<html lang="en">
<head>
<title>OBM - Open Building Management</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="lib/bootstrap-4.5.3-dist/css/bootstrap.min.css">
<script src="lib/jquery-3.5.1.min.js"></script>
<script src="lib/bootstrap-4.5.3-dist/js/bootstrap.bundle.min.js"></script>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
overflow-x: hidden;
overflow-y: auto;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row-sm" id="info">
<table class="table">
<tr><td><img src=img/logo.svg class="img-fluid"></td></tr>
<tr><td>
<dd>Chez OBM, nous prenons soin de vos systèmes énergétiques, chaudières, centrales de traitement d'air.</dd>
<dd>Nous en supervisons le fonctionnement et faisons le lien avec votre exploitant pour la maintenance préventive.</dd>
<dd>
Nos algorithmes d'intelligence artificielle optimisent la distribution dans vos bâtiments,
pour vous permettre d'économiser de l'énergie sans aucune dégradation du confort.
</dd>
</td></tr>
</table>
</div>
<div class="row-sm">
<div class="col-sm">
<button id="v3v">Vanne</button>
<button id="pump">Pompe</button>
<button id="servo">Servomoteur</button>
<button id="burner">Bruleur</button>
</div>
<div class="col-sm" id="cta"></div>
</div>
</div>
<script type="module">
import * as THREE from './lib/three.module.js';
//import { GUI } from './jsm/libs/dat.gui.module.js';
import { OrbitControls } from './lib/controls/OrbitControls.js';
import { ColladaLoader } from './lib/loaders/ColladaLoader.js';
let container, info;
let camera, scene, renderer, hvac;
init("V3V");
//render();
animate();
$("#v3v").click(function(){
init("V3V");
});
$("#pump").click(function(){
init("pompes");
});
$("#servo").click(function(){
init("servo");
});
$("#burner").click(function(){
init("bruleur");
});
function init(element) {
document.getElementById( 'cta' ).innerHTML = "";
container = document.getElementById( 'cta' );
info = document.getElementById( 'info' );
var minus = $(info).height();
camera = new THREE.PerspectiveCamera( 10, window.innerWidth /(window.innerHeight - minus), 0.1, 50 );
camera.position.set( 10, 10, 20 );
//camera.position.set( -3, 0, -6 );
camera.lookAt( 0, 0, 0 );
scene = new THREE.Scene();
//0xcbdbf4
scene.background = new THREE.Color( 0xffffff );
//camera helper
//const helper = new THREE.CameraHelper( camera );
//scene.add( helper );
//grid helper
const size = 10;
const divisions = 10;
const gridHelper = new THREE.GridHelper( size, divisions );
scene.add( gridHelper );
// loading the collada file produced with sketchup
const loadingManager = new THREE.LoadingManager( function () {
scene.add( hvac );
} );
const loader = new ColladaLoader( loadingManager );
//loader.load( './models/collada/chaufferie.dae', function ( collada ) {
loader.load( './collada/'+element+'.dae', function ( collada ) {
hvac = collada.scene;
} );
//087656
const ambientLight = new THREE.AmbientLight( 0xffffff, 0.4 );
scene.add( ambientLight );
const directionalLight = new THREE.DirectionalLight( 0xffffff, 0.8 );
directionalLight.position.set( 1, 1, 0 ).normalize();
scene.add( directionalLight );
//
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight - minus);
renderer.localClippingEnabled = true;
//document.body.appendChild( renderer.domElement );
const controls = new OrbitControls( camera, renderer.domElement );
controls.addEventListener( 'change', render ); // use only if there is no animation loop
//controls.minDistance = 1;
//controls.maxDistance = 10;
controls.enablePan = false;
container.appendChild( renderer.domElement );
window.addEventListener( 'resize', onWindowResize );
}
function onWindowResize() {
info = document.getElementById( 'info' );
var minus = $(info).height();
camera.aspect = window.innerWidth / (window.innerHeight - minus);
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight - minus );
}
function animate() {
requestAnimationFrame( animate );
render();
}
function render() {
//var vector = camera.position.clone();
//console.log(vector);
renderer.render( scene, camera );
}
</script>
</body>
</html>