question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ratio shows error in a-frame v0.5.0

See original GitHub issue
<a-entity
        geometry="primitive:plane;width:45;height:17;"
        look-at="[camera]"
        position="0 0 0"
        material="shader:html;target:#hide-info;transparent:true;ratio:width;opacity:1;">
      </a-entity>

If I set ratio in material, it shows me an error:

aframe-html-shader.js?2520:432 Uncaught (in promise) TypeError: Cannot read property 'width' of undefined
    at NewShader.__draw (eval at <anonymous> (app.js:1729), <anonymous>:432:41)
    at eval (eval at <anonymous> (app.js:1729), <anonymous>:566:18)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
derhuebiiicommented, Apr 5, 2017

Actually it’s even easier than I proposed, just replace the following:

 - var _el$getObject3D$geome = this.el.getObject3D('mesh').geometry.parameters;
+ var _el$getObject3D$geome = this.el.getObject3D('mesh').geometry.metadata.parameters;
1reaction
jason90929commented, Mar 24, 2017

I made it work! But I think I’m just using hard code to do what I want add these code into line 433 in dist/aframe-html-shader.js

 - var _el$getObject3D$geome = this.el.getObject3D('mesh').geometry.parameters;
 - var width = _el$getObject3D$geome.width;
 - var height = _el$getObject3D$geome.height;
 + const material = this.el.getAttribute('material')
 + const target = document.querySelector(material.target)
 + if (!target) return
 + const width = target.clientWidth / 4
 + const height = target.clientHeight / 4
Read more comments on GitHub >

github_iconTop Results From Across the Web

On camera zoom camera aspect has wrong values ... - GitHub
I have to handle zoom and fov with an Aframe camera. ... default Aframe Behavior breaking ( Aspect Ratio will not display at...
Read more >
FAQ - A-Frame
A-Frame uses meters with a 1:1 ratio since the WebVR API also uses meters. 5 units in A-Frame is equal to 5 meters...
Read more >
New features in A-Frame Inspector v0.5.0
Input box: Hover the mouse over it and it will show the complete URL of the asset. Open in a new tab: It...
Read more >
How can I load an a-frame's a-image that doesn't have a 1:1 ...
Looking at the console I see this error which didn't show on the 1:1 image. THREE.WebGLRenderer: Texture has been resized from (1000x667) to...
Read more >
Frame error-rate performance for voice traffic - ResearchGate
5 -7 show that the performance of the adaptive application and physical ... HM system in a Nakagami m=1 channel with a frame...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found