agentscript
Version:
AgentScript Model in Model/View architecture
52 lines (43 loc) • 1.22 kB
HTML
<html>
<head>
<title>wander3d</title>
<link rel="icon" type="image/x-icon" href="../favicon.ico" />
</head>
<body>
<script type="module">
import * as util from '../src/utils.js'
import ThreeDraw from '../src/ThreeDraw.js'
import Model from '../models/Wander3DModel.js'
const drawOptions = {
turtlesShape: 'Dart',
turtlesColor: 'random',
turtlesSize: 3,
}
async function run() {
const model = new Model()
await model.startup()
model.setup()
const view = new ThreeDraw(
model,
{
div: document.body, //'modelDiv',
turtles: { meshClass: 'Obj3DMesh', useAxes: true },
},
drawOptions
)
util.toWindow({ util, model, view })
await util.timeoutLoop(
() => {
model.step()
view.draw()
},
-1, //500,
33 // 33
)
view.idle()
}
run()
</script>
<div id="modelDiv"></div>
</body>
</html>