0.0.1 • Published 3 years ago

mofron-comp-three v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

mofron-comp-three

mofron is module based frontend framework.

threejs component for mofron

Install

npm install mofron mofron-comp-three

Sample

<setting>
    <tag load="mofron-comp-three">Three</tag>
</setting>

<script run=init>
let ani_evt = (box) => {
    box.rotation.y += 0.01;
};
</script>

<script run=after>
let THREE = three.THREE();
const scene = new THREE.Scene();

const camera = new THREE.PerspectiveCamera(45, three.width() / three.height());
camera.position.set(0, 0, +1000);

const geometry = new THREE.BoxGeometry(400, 400, 400);
const material = new THREE.MeshNormalMaterial();
const box = new THREE.Mesh(geometry, material);
scene.add(box);

three.scene(scene);
three.camera(camera);
three.animateEvent(ani_evt, box);
</script>

<Three name=three size=(800,600)></Three>

Parameter

ShortFormParameter NameTypeDescription
rendererobjectthreejs renderer
widthnumberpx number
heightnumberpx number
autoAnimatebooleantrue: call animation loop autometally
false: call animation loop by manually
animateEventfunctionanimate event function
mixedanimate event parameter
animatesceneobjectthreejs scene object
cameraobjectthreejs camera object
THREE
0.0.1

3 years ago