default voxel colors and transparency fixed
This commit is contained in:
@@ -56,10 +56,16 @@ export const ObjectView = observer(function ({ object }: ObjectViewProps) {
|
||||
{
|
||||
objectType.voxels.map((v, idx) => {
|
||||
const vt = state.world.getVoxelTypeById(v.typeId);
|
||||
const color = (v.color ?? vt?.color) ?? 'white';
|
||||
const opacity = (v.opacity ?? vt?.opacity) ?? 1;
|
||||
return (
|
||||
<mesh key={idx} position={v.position}>
|
||||
<boxGeometry args={[1, 1, 1]} />
|
||||
<meshStandardMaterial color={(v.color ?? vt?.color) ?? 'white'} opacity={(v.opacity ?? vt?.opacity) ?? 1} />
|
||||
<meshStandardMaterial
|
||||
color={color}
|
||||
opacity={opacity}
|
||||
transparent={opacity < 1}
|
||||
/>
|
||||
{isSelected && <Edges color="white" lineWidth={3} stencilWrite={false} />}
|
||||
</mesh>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user