Closed dusunax closed 1 year ago
wireframeMaterial
on mesh, there was an issue where the wireframe was not appearing on the screen. seemed that when setting the color
of the wireframe mesh, it appeared with the color of the entire mesh instead of the color of the lines.
const material = new THREE.MeshStandardMaterial({
color: "#fffcf1",
});
// material as wireframe const wireframeMaterial = new THREE.MeshBasicMaterial({ color: 0x0000ff, wireframe: true, transparent: true, });
const mesh = new THREE.Mesh(geometry, material); const wireframe = new THREE.Mesh(geometry, wireframeMaterial); ... mesh.add(wireframe);
<img src="https://github.com/dusunax/dicom-viewer/assets/94776135/43c5552a-0f0c-4ed2-a652-542c055cc133" width="700px">
<img src="https://github.com/dusunax/dicom-viewer/assets/94776135/7f406bf8-0bf9-4b0e-8d94-af7ed0e77b5d" width="300px">
- appeared that when changing the color, the entire mesh's color was affected
## Zoom in π
- while observing the screen with OrbitControls, discovered the cause of the issue when zooming in.
- The triangles' faces were too small, causing the lines to overlap and appear as faces.
<img src="https://github.com/dusunax/dicom-viewer/assets/94776135/19edd38d-489b-4eb8-9596-07a8ea410dcf" width="700px">
## add opacity
- added opacity to make the overlapping lines appear lighter.
<img src="https://github.com/dusunax/dicom-viewer/assets/94776135/a1edcd9c-0d36-4e82-bae3-219b6ffeb0d9" width="500px">
<img src="https://github.com/dusunax/dicom-viewer/assets/94776135/5404381c-637b-42e1-b9ea-b03106aaf348" width="500px">
<img src="https://github.com/dusunax/dicom-viewer/assets/94776135/64bb1a57-9c37-429d-b4cb-390b171590c0" width="700px">
## to be continue...
- however, setting opacity did not completely resolve the issue.
also looking into the way to display the mesh by simplifying the faces.
230611 - Handle three.js with tasks
5
[refactor] refactor
PLYModel.tsx
by seperate functions by features.π Works μμ λ΄μ©
B. Tri mesh rendering
C. Raycasting with arcball
[refactor] refactor
PLYModel.tsx
B. Tri mesh rendering π
// material as wireframe const wireframeMaterial = new THREE.MeshBasicMaterial({ color: 0x0000ff, wireframe: true, transparent: true, opacity: 0.3, // add for solving issue (comment below) });
const mesh = new THREE.Mesh(geometry, material); const wireframe = new THREE.Mesh(geometry, wireframeMaterial); ... mesh.add(wireframe);
render()
functionvar directionalLight = new THREE.DirectionalLight(0xffffff, 1); directionalLight.position.set(1, 1, 0).normalize(); lightHolder.add(directionalLight);
const light = new THREE.AmbientLight("#FFF", 0.3); lightHolder.add(light);
scene.add(lightHolder);
add render mode state
C. Raycasting with arcball π