Published
Edited
Apr 15, 2021
Insert cell
Insert cell
FileAttachment("tank_pos.png")
Insert cell
Insert cell
Insert cell
Gunnerus.derivedObjects[0].id = "Tank8"
Insert cell
Gunnerus.derivedObjects[0].baseObject = "8.No6.sb.FO.#20-A.settl"
Insert cell
Gunnerus.derivedObjects[0].referenceState = {xCentre: 13.102, yCentre: -0.904, zBase: 0.627}
Insert cell
Insert cell
Gunnerus.baseObjects[0].id = "8.No6.sb.FO.#20-A.settl"
Insert cell
Gunnerus.baseObjects[0].boxDimensions = {length: 4.000, breadth: 1.875, height: 1.400}
Insert cell
Gunnerus.baseObjects[0].weightInformation.contentDensity = 830
Insert cell
Gunnerus.baseObjects[0].weightInformation.volumeCapacity = 7.783
Insert cell
Insert cell
Gunnerus.baseObjects[0].weightInformation.fullnessCGMapping.fullnesses = [0.00, 0.25, 0.49, 0.74, 1.00]
Insert cell
Gunnerus.baseObjects[0].weightInformation.fullnessCGMapping.cgs = [
[13.18, 0.29, -0.1],
[12.4, 0.8, 0.22],
[12.21, 0.87, 0.35],
[12.14, 0.89, 0.49],
[12.1, 0.9, 0.63]
]
Insert cell
Gunnerus.baseObjects[0]
Insert cell
ship = new Vessel.Ship(Gunnerus);
Insert cell
ship3D = new Ship3D(ship);
Insert cell
{
const renderer = new THREE.WebGLRenderer({antialias: true});
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xA9CCE3);
const height = 600;
const aspect = width / height;
const camera = new THREE.PerspectiveCamera(50);
camera.up.set(0, 0, 1);
scene.add(camera);
const LOA = ship.structure.hull.attributes.LOA;
camera.position.set(0.7 * LOA, 0.7 * LOA, 0.7 * LOA);
function onWindowResize() {
renderer.setSize(width, height);
camera.aspect = width / height;
camera.updateProjectionMatrix();
}
window.addEventListener('resize', onWindowResize);
const controls = new THREE.OrbitControls(camera, renderer.domElement);
controls.target = new THREE.Vector3(LOA / 2, 0, 0);
controls.update();
invalidation.then(() => renderer.dispose());
renderer.setSize(width, height);
renderer.setPixelRatio(devicePixelRatio);
scene.add(ship3D);
const ambientLight = new THREE.AmbientLight(0xffffff, 0.3);
const mainLight = new THREE.DirectionalLight(0xffffff, 1);
mainLight.position.set(1, 1, 1);
scene.add(ambientLight, mainLight);
var animate = function () {
requestAnimationFrame( animate );
renderer.render( scene, camera );
};
animate();
yield renderer.domElement;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more