aframe-extras
Version:
Add-ons and examples for A-Frame VR.
25 lines (24 loc) • 477 B
JavaScript
/**
* Flat grid.
*
* Defaults to 75x75.
*/
AFRAME.registerPrimitive('a-grid', {
defaultComponents: {
geometry: {
primitive: 'plane',
width: 75,
height: 75
},
rotation: {x: -90, y: 0, z: 0},
material: {
src: 'url(https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v1.16.3/assets/grid.png)',
repeat: '75 75'
}
},
mappings: {
width: 'geometry.width',
height: 'geometry.height',
src: 'material.src'
}
});