aframe-fit-texture-component
A fit-texture component for A-Frame VR. The fit-texture
component can be used with entities that use the material
component with a image or video as texture.
Instead of modifying the texture, this component modifies the entities geometry
(width/height) to match the textures dimensions perfectly. Tested in A-Frame 1.0.4.
Usage
Browser Installation
Install and use by directly including the browser files:
My A-Frame Scene <!-- or better: download aframe and this component, and server it from your local directory --> <!-- Before: This entity will have a stretched image, unless you know and specify width/height manually. --> <!-- Now: The entity will scale according to the texture. --> <!--using a fixed width works fine too, the height gets set automatically.--> <!--Same as above but with a fixed height:--> <!--`a-images` work of course:--> <!-- As well as `a-video` -->
NPM Installation
Install via NPM:
npm install aframe-fit-texture-component
Then register and use.
;;