html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<html>
<head>
<title>GYROSCOPIC CONTROL OF SMALL CRAFT</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.2/dat.gui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/92/three.js"></script>
<script src="https://dl.dropbox.com/s/nn9wz6aimz6vzoi/OBJLoader.js?dl=0"></script>
<script src="https://dl.dropbox.com/s/2821pj5wkc2b8pe/MTLLoader.js?dl=0"></script>
<script src="https://dl.dropbox.com/s/qxgrvxduynnst3u/OrbitControls.js?dl=0"></script>
</head>
<body style="margin: 0px;">
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
Enter to Rename, Shift+Enter to Preview
js
js
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
window.addEventListener('load', function(){ //JQuery function
/* Thank you all for 100 likes!
The simulation should work in browsers and on phones thanks to WebGL and OpenGL ES. I hope you like the simulation. Use computer for best readability of the code.
Some information for those interested, these are my preferences when making 3D simulations:
- Writing the JavaScript code: Sublime Text
- Testing the code: Firefox browser
- Making the models: Blender (and exporting as .obj and .mtl)
- Finding equations of motion: MatLab
*/
console.log=function(){};
alert("Hi, and thanks for checking out my code!\n\nThis is a ship simulation that shows the effect of two gyroscopic stabilizers. The principle is that the moment induced by the gyroscopes cancels out the moment induced by waves.\n\nThe equations of motion were found using The Moving Frame method in dynamics with the help from Thomas Impelusso. The equations of motion were found using MatLab. Keep in mind that many simplifications have been made, and thus this is not a true simulation of what would really happen. The work presented is the result of a bachelor thesis written by me and my group.\n\nPlay around with the GUI and have fun! :-)\n\nFor those who want to learn, the maths is probably confusing, but I have tried to comment most of the code.");
/* Thanks to the rest of my bachelor group:
- Håkon Teigland
- Andreas Flåten
- Martin R. Lied
- Caspar C. Smith
The bachelor thesis can be read here:
http://home.hib.no/prosjekter/dynamics/2017/gyroscope/
*/
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run