Spaces:
Running
Running
Update viewer.js
Browse files
viewer.js
CHANGED
|
@@ -478,7 +478,7 @@ export function resetViewerCamera() {
|
|
| 478 |
* Change the main model's diffuse color in real time.
|
| 479 |
* r,g,b are floats [0,1]. This is a reusable function for new colors.
|
| 480 |
*/
|
| 481 |
-
export function changeColor(dr, dg, db, er, eg, eb, boolTrans) {
|
| 482 |
|
| 483 |
//cameraEntity.camera.clearColor = new pc.Color(colorBgR, colorBgG, colorBgB);
|
| 484 |
|
|
@@ -487,6 +487,7 @@ export function changeColor(dr, dg, db, er, eg, eb, boolTrans) {
|
|
| 487 |
|
| 488 |
matTransparent.diffuse.set(dr, dg, db);
|
| 489 |
matTransparent.emissive.set(er, eg, eb);
|
|
|
|
| 490 |
matTransparent.update();
|
| 491 |
|
| 492 |
tubeTransparent.diffuse.set(dr, dg, db);
|
|
|
|
| 478 |
* Change the main model's diffuse color in real time.
|
| 479 |
* r,g,b are floats [0,1]. This is a reusable function for new colors.
|
| 480 |
*/
|
| 481 |
+
export function changeColor(dr, dg, db, er, eg, eb, op, boolTrans) {
|
| 482 |
|
| 483 |
//cameraEntity.camera.clearColor = new pc.Color(colorBgR, colorBgG, colorBgB);
|
| 484 |
|
|
|
|
| 487 |
|
| 488 |
matTransparent.diffuse.set(dr, dg, db);
|
| 489 |
matTransparent.emissive.set(er, eg, eb);
|
| 490 |
+
matTransparent.opacity = op;
|
| 491 |
matTransparent.update();
|
| 492 |
|
| 493 |
tubeTransparent.diffuse.set(dr, dg, db);
|