You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried <MeshReflectorMaterial /> but I noticed a strange behaviour with geometries exported from Blender.
On the right I applied the material to a <planeGeometry /> and it works fine
On the left I applied the material to a Blender exported plane and the reflection is wrong.
Just as a hint: I noticed that running this code "fixes" the reflection
functionComp(){const{ nodes }=useGLTF('/models/plane.glb')// plane exported from BlenderconstplaneThree=newPlaneGeometry(2,2)constplaneGLB=nodes['Plane']functionfixGeom(g: BufferGeometry){g.deleteAttribute('position')g.setAttribute('position',planeThree.attributes.position.clone())g.setIndex(planeThree.index!.clone())// seems like position and index data is what differ from Blender and Three's planesg.computeVertexNormals()}fixGeom(planeGLB.geometry)
The text was updated successfully, but these errors were encountered:
I guess <MeshReflectorMaterial /> expects vertices to have a specific local space position (eg: similar to THREE's default planeGeometry): the reflections works fine when using a plane.glb exported with the rotation applied to the vertices of the geometry.
I tried
<MeshReflectorMaterial />
but I noticed a strange behaviour with geometries exported from Blender.On the right I applied the material to a
<planeGeometry />
and it works fineOn the left I applied the material to a Blender exported plane and the reflection is wrong.
MRE: https://codesandbox.io/p/sandbox/meshreflectormaterial-strange-behaviour-p63gh3?file=%2Fsrc%2FApp.js%3A33%2C31
Is this expected?
Just as a hint: I noticed that running this code "fixes" the reflection
The text was updated successfully, but these errors were encountered: