unify timeline, world. shadeless schematics.
This commit is contained in:
236
index.html
236
index.html
@@ -32,95 +32,16 @@
|
||||
<main>
|
||||
<h1>Visualizer</h1>
|
||||
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ullamcorper ut mauris sed
|
||||
tempor. Nunc
|
||||
vehicula tempor purus, non vestibulum libero ornare non. Morbi fringilla sapien diam, sed
|
||||
rhoncus lacus egestas
|
||||
vel.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ullamcorper ut mauris sed
|
||||
tempor. Nunc
|
||||
vehicula tempor purus, non vestibulum libero ornare non. Morbi fringilla sapien diam, sed
|
||||
rhoncus lacus egestas
|
||||
vel.
|
||||
</p>
|
||||
<h2>Static</h2>
|
||||
|
||||
<div class="figure" id="demo-1"></div>
|
||||
|
||||
<p>
|
||||
Curabitur vestibulum vitae orci ac laoreet. Donec vel imperdiet tortor. Vestibulum lobortis
|
||||
aliquam tellus,
|
||||
vitae viverra nisi porttitor quis. Pellentesque id efficitur arcu. Nunc laoreet pulvinar
|
||||
ligula eu maximus.
|
||||
Mauris ullamcorper accumsan dui vel pulvinar.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Curabitur vestibulum vitae orci ac laoreet. Donec vel imperdiet tortor. Vestibulum lobortis
|
||||
aliquam tellus,
|
||||
vitae viverra nisi porttitor quis. Pellentesque id efficitur arcu. Nunc laoreet pulvinar
|
||||
ligula eu maximus.
|
||||
Mauris ullamcorper accumsan dui vel pulvinar.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Curabitur vestibulum vitae orci ac laoreet. Donec vel imperdiet tortor. Vestibulum lobortis
|
||||
aliquam tellus,
|
||||
vitae viverra nisi porttitor quis. Pellentesque id efficitur arcu. Nunc laoreet pulvinar
|
||||
ligula eu maximus.
|
||||
Mauris ullamcorper accumsan dui vel pulvinar.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Curabitur vestibulum vitae orci ac laoreet. Donec vel imperdiet tortor. Vestibulum lobortis
|
||||
aliquam tellus,
|
||||
vitae viverra nisi porttitor quis. Pellentesque id efficitur arcu. Nunc laoreet pulvinar
|
||||
ligula eu maximus.
|
||||
Mauris ullamcorper accumsan dui vel pulvinar.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Curabitur vestibulum vitae orci ac laoreet. Donec vel imperdiet tortor. Vestibulum lobortis
|
||||
aliquam tellus,
|
||||
vitae viverra nisi porttitor quis. Pellentesque id efficitur arcu. Nunc laoreet pulvinar
|
||||
ligula eu maximus.
|
||||
Mauris ullamcorper accumsan dui vel pulvinar.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Curabitur vestibulum vitae orci ac laoreet. Donec vel imperdiet tortor. Vestibulum lobortis
|
||||
aliquam tellus,
|
||||
vitae viverra nisi porttitor quis. Pellentesque id efficitur arcu. Nunc laoreet pulvinar
|
||||
ligula eu maximus.
|
||||
Mauris ullamcorper accumsan dui vel pulvinar.
|
||||
</p>
|
||||
|
||||
<h2>Dynamic</h2>
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr;">
|
||||
<div class="figure" id="demo-2"></div>
|
||||
<div class="figure" id="demo-3"></div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Curabitur tincidunt sapien et diam fringilla, eu accumsan odio faucibus. Orci varius natoque
|
||||
penatibus et magnis
|
||||
dis parturient montes, nascetur ridiculus mus.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Curabitur tincidunt sapien et diam fringilla, eu accumsan odio faucibus. Orci varius natoque
|
||||
penatibus et magnis
|
||||
dis parturient montes, nascetur ridiculus mus.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Curabitur tincidunt sapien et diam fringilla, eu accumsan odio faucibus. Orci varius natoque
|
||||
penatibus et magnis
|
||||
dis parturient montes, nascetur ridiculus mus.
|
||||
</p>
|
||||
|
||||
<div id="atlas-container"
|
||||
style="position: fixed; left: 0; top: 0; border: 1px solid white;"></div>
|
||||
</main>
|
||||
@@ -135,61 +56,50 @@
|
||||
const engine = new Engine();
|
||||
document.getElementById('atlas-container')?.appendChild(engine.atlas.canvas);
|
||||
|
||||
const world1 = new World();
|
||||
world1.set('minecraft:redstone_wire', -1, 0, 0, {
|
||||
east: 'side',
|
||||
west: 'none',
|
||||
north: 'none',
|
||||
south: 'none',
|
||||
power: '15'
|
||||
});
|
||||
world1.set('minecraft:repeater', 0, 0, 0, {
|
||||
facing: 'east',
|
||||
delay: '1',
|
||||
locked: 'false',
|
||||
powered: 'true'
|
||||
});
|
||||
world1.set('minecraft:oak_trapdoor', 2, 0, 0, {
|
||||
facing: 'east',
|
||||
half: 'bottom',
|
||||
open: 'true'
|
||||
});
|
||||
world1.set('lodestone', 0, -1, 0);
|
||||
world1.set('piston', 0, -2, 0, {facing: 'north', extended: 'false'});
|
||||
const world1 = new World(`
|
||||
p -1 0 0 redstone_wire east=side west=none north=none south=none power=15
|
||||
p 0 0 0 repeater facing=east delay=1 locked=false powered=true
|
||||
p 2 0 0 oak_trapdoor facing=east half=bottom open=true
|
||||
p 0 -1 0 lodestone
|
||||
p 0 -2 0 piston facing=north extended=false
|
||||
`)
|
||||
|
||||
const world2 = new World();
|
||||
world2.set('minecraft:redstone_wire', 0, 0, 0, {
|
||||
east: 'side',
|
||||
west: 'none',
|
||||
north: 'none',
|
||||
south: 'none',
|
||||
power: '0'
|
||||
});
|
||||
world2.set('minecraft:repeater', 1, 0, 0, {
|
||||
facing: 'east',
|
||||
delay: '4',
|
||||
locked: 'false',
|
||||
powered: 'false'
|
||||
});
|
||||
world2.set('minecraft:sticky_piston', 2, 0, 0, {facing: 'east', extended: 'false'});
|
||||
world2.set('minecraft:sticky_piston', 2, 0, 1, {facing: 'east', extended: 'true'});
|
||||
world2.set('minecraft:sticky_piston', 2, 0, 2, {facing: 'east', extended: 'true'});
|
||||
world2.set('minecraft:piston_head', 2.5, 0, 1, {
|
||||
facing: 'east',
|
||||
short: 'true',
|
||||
type: 'sticky'
|
||||
});
|
||||
world2.set('minecraft:piston_head', 3, 0, 2, {
|
||||
facing: 'east',
|
||||
short: 'false',
|
||||
type: 'sticky'
|
||||
});
|
||||
world2.set('minecraft:glass', 3, 0, 0);
|
||||
world2.set('minecraft:observer', 3.5, 0, 1, {facing: 'up', powered: 'true'});
|
||||
world2.set('minecraft:redstone_block', 4, 0, 2);
|
||||
const world2 = new World(`
|
||||
p 0 0 0 redstone_wire power=0 east=side west=none north=none south=none
|
||||
p 1 0 0 repeater facing=west powered=false locked=false delay=2
|
||||
p 2 0 0 piston facing=east extended=false
|
||||
|
||||
t 2
|
||||
p 0 0 0 power=15
|
||||
|
||||
t 6
|
||||
p 1 0 0 powered=true
|
||||
|
||||
t 7
|
||||
p 2 0 0 extended=true
|
||||
p 2.5 0 0 piston_head facing=east short=true type=normal
|
||||
|
||||
t 8
|
||||
p 2.5 0 0 air
|
||||
p 3 0 0 piston_head facing=east short=false type=normal
|
||||
|
||||
t 12
|
||||
p 0 0 0 power=0
|
||||
|
||||
t 16
|
||||
p 1 0 0 powered=false
|
||||
|
||||
t 17
|
||||
p 3 0 0 air
|
||||
p 2.5 0 0 piston_head facing=east short=true type=normal
|
||||
|
||||
t 18
|
||||
p 2.5 0 0 air
|
||||
p 2 0 0 extended=false
|
||||
`);
|
||||
|
||||
const demo1 = new Diorama('demo-1', world1, () => engine.requestRender())
|
||||
demo1.radius = 2;
|
||||
demo1.radius = 3;
|
||||
demo1.phi = 10;
|
||||
demo1.theta = -5;
|
||||
demo1.target = [0.5, 0, 0.5]
|
||||
@@ -197,7 +107,7 @@
|
||||
engine.addDiorama(demo1);
|
||||
|
||||
const demo2 = new Diorama('demo-2', world2, () => engine.requestRender())
|
||||
demo2.radius = 4;
|
||||
demo2.radius = 5;
|
||||
demo2.theta = 180;
|
||||
demo2.phi = 90;
|
||||
demo2.centerView()
|
||||
@@ -205,9 +115,7 @@
|
||||
engine.addDiorama(demo2);
|
||||
|
||||
const demo3 = new Diorama('demo-3', world2, () => engine.requestRender())
|
||||
demo3.radius = 4;
|
||||
demo3.theta = 0;
|
||||
demo3.phi = 0;
|
||||
demo3.radius = 5;
|
||||
demo3.centerView()
|
||||
demo3.saveState()
|
||||
engine.addDiorama(demo3);
|
||||
@@ -215,51 +123,21 @@
|
||||
// Fetch and build everything concurrently!
|
||||
await engine.updateAll();
|
||||
|
||||
function set0() {
|
||||
world2.set('minecraft:sticky_piston', 2, 0, 2, {facing: 'east', extended: 'false'});
|
||||
world2.set('minecraft:redstone_block', 3, 0, 2);
|
||||
world2.del(2.5, 0, 2);
|
||||
world2.del(3.5, 0, 2);
|
||||
setTimeout(set1, 250)
|
||||
}
|
||||
const factor = 1;
|
||||
setInterval(() => {
|
||||
for (let i = 0; i < 20; i++) {
|
||||
setTimeout(() => world2.seek(i), i * factor * 50)
|
||||
}
|
||||
}, factor * 1000)
|
||||
|
||||
function set1() {
|
||||
world2.set('minecraft:sticky_piston', 2, 0, 2, {facing: 'east', extended: 'true'});
|
||||
world2.del(3, 0, 2)
|
||||
world2.set('minecraft:piston_head', 2.5, 0, 2, {
|
||||
facing: 'east',
|
||||
short: 'true',
|
||||
type: 'sticky'
|
||||
});
|
||||
world2.set('minecraft:redstone_block', 3.5, 0, 2);
|
||||
setTimeout(set2, 250)
|
||||
}
|
||||
// let i = 0;
|
||||
// let n = world2.eventCount;
|
||||
// setInterval(() => {
|
||||
// world2.seekIndex(i);
|
||||
// i = (i + 1) % n;
|
||||
// }, 500);
|
||||
|
||||
function set2() {
|
||||
world2.set('minecraft:piston_head', 3, 0, 2, {
|
||||
facing: 'east',
|
||||
short: 'false',
|
||||
type: 'sticky'
|
||||
});
|
||||
world2.del(2.5, 0, 2);
|
||||
world2.del(3.5, 0, 2);
|
||||
world2.set('minecraft:redstone_block', 4, 0, 2);
|
||||
setTimeout(set3, 250)
|
||||
}
|
||||
|
||||
function set3() {
|
||||
world2.del(4, 0, 2)
|
||||
world2.del(3, 0, 2)
|
||||
world2.set('minecraft:piston_head', 2.5, 0, 2, {
|
||||
facing: 'east',
|
||||
short: 'true',
|
||||
type: 'sticky'
|
||||
});
|
||||
world2.set('minecraft:redstone_block', 3.5, 0, 2);
|
||||
setTimeout(set0, 250)
|
||||
}
|
||||
|
||||
setTimeout(set3, 1000)
|
||||
} catch (err) {
|
||||
console.error("Renderer Initialization Failed:", err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user