@quick-threejs/reactive 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,7 +40,16 @@ import { launchApp } from "@quick-threejs/reactive/worker";
|
|
|
40
40
|
|
|
41
41
|
launchApp({
|
|
42
42
|
onReady: (app) => {
|
|
43
|
-
const
|
|
43
|
+
const ambientLight = new AmbientLight(0xffffff, 0.1);
|
|
44
|
+
const directionalLight = new DirectionalLight(0xffffff, 0.8);
|
|
45
|
+
directionalLight.position.set(0, 0, 1);
|
|
46
|
+
|
|
47
|
+
const torus = new Mesh(
|
|
48
|
+
new TorusKnotGeometry(0.8, 0.35, 100, 16),
|
|
49
|
+
new MeshToonMaterial({
|
|
50
|
+
color: 0x454545
|
|
51
|
+
})
|
|
52
|
+
);
|
|
44
53
|
|
|
45
54
|
self.onmessage = (event: MessageEvent) => {
|
|
46
55
|
if (event.data?.type === "torus-x-gui-event") {
|
|
@@ -49,8 +58,7 @@ launchApp({
|
|
|
49
58
|
};
|
|
50
59
|
|
|
51
60
|
app.world.scene().background = new Color("#211d20");
|
|
52
|
-
|
|
53
|
-
app.world.scene().add(torus);
|
|
61
|
+
app.world.scene().add(ambientLight, directionalLight, torus);
|
|
54
62
|
|
|
55
63
|
app.resize$?.().subscribe((event) => {
|
|
56
64
|
console.log(event.type);
|
|
@@ -69,7 +77,7 @@ launchApp({
|
|
|
69
77
|
```
|
|
70
78
|
|
|
71
79
|
After the configuration of the main part and the worker part, you should have the following screen:
|
|
72
|
-

|
|
73
81
|
|
|
74
82
|
**See the complete [Example folder](../../samples/with-reactive/).**
|
|
75
83
|
|