so i'm basically trying to render a json onto a canvas via aframe, u did successfully get it to map onto a canvas in three.js, but when i try to replicate this in aframe, it just show a white frame, it shows that it is there, but no animation is shown.
unable to render in aframe (https://glitch.com/edit/#!/sun-innate-cupboard)
able to render in three.js (https://jsfiddle.net/crays/15cgbvsp)
function init() {
camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.01, 10 );
camera.position.z = 5;
scene = new THREE.Scene();
scene.background = new THREE.Color( 0xffffff );
const canvas = document.createElement( 'canvas' );
canvas.width = 1024;
canvas.height = 1024;
const context = canvas.getContext( '2d' );
const animation = bodymovin.loadAnimation( {
container: document.getElementById( 'bm' ),
renderer: 'canvas',
rendererSettings: {
context: context
},
loop: true,
autplay: true,
path: 'https://assets5.lottiefiles.com/packages/lf20_mb9ka7yz.json'
//animationData: json
} );
const texture = new THREE.CanvasTexture( canvas );
const geometry = new THREE.PlaneGeometry();
const material = new THREE.MeshBasicMaterial( { map: texture } );
mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
}
function animate() {
requestAnimationFrame( animate );
mesh.material.map.needsUpdate = true;
renderer.render( scene, camera );
}
could it be something that i'm missing ?
