maxkrieger / aframe-draw-component

HTML5 canvas component for AFrame VR.
http://a9.io/aframe-draw-component/
57 stars 8 forks source link

Does not work with latest aframe branch #4

Open amicoleo opened 8 years ago

amicoleo commented 8 years ago

Hi,

The components works perfectly if using aframe-core, as you have in your package "aframe-core": "0.1.2", but the with the latest aframe branch "aframe": "aframevr/aframe#dev" The canvas is not drawn on the entity and I didn't get any message on the console about it.

maxkrieger commented 8 years ago

Hmm, I'll look into this. The latest aframe branch has custom shaders which are probably which'll be used for this module once it's released.

meta-meta commented 8 years ago

I just ran into this. To fix it, in createCanvas:

change

this.el.object3D.material = new THREE.MeshBasicMaterial();
this.el.object3D.material.map = this.texture;

to

this.el.object3D.children[0].material = new THREE.MeshBasicMaterial();
this.el.object3D.children[0].material.map = this.texture;
maxkrieger commented 8 years ago

I'll take care of this tomorrow, thanks!

On Fri, Mar 18, 2016 at 4:54 PM, Paul M. Christian <notifications@github.com

wrote:

I just ran into this. To fix it, in createCanvas:

change

this.el.object3D.material = new THREE.MeshBasicMaterial(); this.el.object3D.material.map = this.texture;

to

this.el.object3D.children[0].material = new THREE.MeshBasicMaterial(); this.el.object3D.children[0].material.map = this.texture;

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/maxkrieger/aframe-draw-component/issues/4#issuecomment-198538338

maxkrieger commented 8 years ago

This solution isn't backwards compatible, so I made a quick and dirty if...else.

Should be solved in 1.4.0, let me know how it goes.

RSpace commented 8 years ago

I've tried to get this component to work with A-Frame 0.2.0, but it doesn't work.

This example just renders a white cube with A-Frame 0.2.0 and version 1.4.0 of this component:

    <a-scene>
      <a-sky color="blue"></a-sky>
      <a-entity position="0 1 0" geometry="primitive: box" draw="width: 256; height: 256" square="text: Hello">
      </a-entity>
    </a-scene>
maxkrieger commented 8 years ago

@RSpace this should be fixed in 1.5.0.

maltekosian commented 8 years ago

I tried it with the latest branch of aframe.io 0.3.0 and it works fine for me. Though i|ve to admit one should use the complete example code of the repository, not the short hints giving snippets of the repository page. And .. i've a question: is there an issue if one is using html-component, too? I seams to me as a normal draw component is running into a permanent loop than. I can show you some example code, if you want.