How do you paint texture on surfaces in React VR?

I have a 100m x 100m box to act as a floor in the responseVR test I am working on, I would like to add texture to it, but the tile texture just extends across the entire surface, not across the tile as desired.Here is my component code , nothing special:

    <Box
      dimWidth={100}
      dimDepth={100}
      dimHeight={0.5}
      texture={asset('check_floor_tile.jpg')}
      style={{
        color:'#333333',
        transform: [{translate: [0, -1, 0]}]
      }}
      lit
    />

      

I have looked for examples with no success, any help would be appreciated. Thank.

+3


source to share


1 answer


Now you can draw a texture on the surface by pointing repeat

to the texture property of any component that extends BasicMesh

(Box, Plane, Sphere, Cylinder, Model).

The functionality was added to Reach VR via this PR .



<Plane
  texture={{
    ...asset('texture.jpg'),
    repeat: [4, 4],
  }}
/>

      

+2


source







All Articles