@combos-fun/plugin-renderer-3d-img 0.1.14 → 0.1.16
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/agent-skill.md +12 -43
- package/package.json +4 -4
package/agent-skill.md
CHANGED
|
@@ -1,54 +1,23 @@
|
|
|
1
1
|
# `@combos-fun/plugin-renderer-3d-img` — Agent notes
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Prerequisite: follow the parent `@combos-fun/plugin-renderer-3d` skill for system order, named resources, pose seeding, hierarchy, and stale-async handling.
|
|
6
|
-
|
|
7
|
-
## Public API
|
|
3
|
+
One IMAGE on a plane. Parent: `plugin-renderer-3d`. Repeating textures: `TilingSprite3D`.
|
|
8
4
|
|
|
9
5
|
```ts
|
|
10
|
-
import { Img3D, Img3DSystem
|
|
6
|
+
import { Img3D, Img3DSystem } from '@combos-fun/plugin-renderer-3d-img';
|
|
11
7
|
```
|
|
12
8
|
|
|
13
|
-
`componentName = 'Img3D'
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
| Field | Type | Default |
|
|
18
|
-
|-------|------|---------|
|
|
19
|
-
| `resource` | `string` | `''`; empty on ADD is a silent no-op |
|
|
20
|
-
| `positionX/Y/Z` | `number` | `0` |
|
|
21
|
-
| `rotationX/Y/Z` | `number` | `0` radians |
|
|
22
|
-
| `scaleX/Y` | `number` | `1` |
|
|
23
|
-
| `opacity` | `number` | `1` |
|
|
24
|
-
| `doubleSide` | `boolean` | `false` |
|
|
25
|
-
|
|
26
|
-
There is no `scaleZ`, `width`, or `height`. The generated `PlaneGeometry` is `(imageWidth / imageHeight) × 1` world units before scaling.
|
|
9
|
+
`componentName = 'Img3D'`. `systemName = 'Img3DSystem'`.
|
|
27
10
|
|
|
28
|
-
|
|
11
|
+
| Field | Default |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `resource` | `''` — IMAGE name. Empty on add does nothing |
|
|
14
|
+
| `position*` / `rotation*` | `0` |
|
|
15
|
+
| `scaleX` / `scaleY` | `1` |
|
|
16
|
+
| `opacity` | `1` |
|
|
17
|
+
| `doubleSide` | `false` |
|
|
29
18
|
|
|
30
|
-
|
|
31
|
-
- Loading is async. Resource replacement or removal invalidates the old request; a stale texture is disposed before return.
|
|
32
|
-
- Changing `resource` replaces the plane. `opacity` and `doubleSide` update the existing material; pose and scale synchronize per frame.
|
|
33
|
-
- With renderer shadows enabled, the mesh receives `castShadow` and `receiveShadow`.
|
|
34
|
-
|
|
35
|
-
## Package-specific pitfalls
|
|
36
|
-
|
|
37
|
-
- The front face only is visible unless `doubleSide: true`.
|
|
38
|
-
- Use `scaleX/scaleY` to size the image; use `TilingSprite3D` when the texture must repeat.
|
|
39
|
-
- `Img3D.opacity` is the material value, but a sibling `Render3D` overwrites opacity each frame for the root subtree.
|
|
40
|
-
|
|
41
|
-
## Minimal example
|
|
19
|
+
No `scaleZ`, `width`, or `height`. Plane size is `(imageWidth / imageHeight) × 1` before scale. The texture is a new Three texture from `data.image`, not the Pixi image. Front face only unless `doubleSide: true`. Changing `resource` rebuilds the plane. A sibling `Render3D` overwrites `opacity` each frame. Load is async and drops a stale texture.
|
|
42
20
|
|
|
43
21
|
```ts
|
|
44
|
-
|
|
45
|
-
billboard.addComponent(new Img3D({
|
|
46
|
-
resource: 'poster',
|
|
47
|
-
positionZ: -3,
|
|
48
|
-
doubleSide: true,
|
|
49
|
-
}));
|
|
22
|
+
billboard.addComponent(new Img3D({ resource: 'poster', positionZ: -3, doubleSide: true }));
|
|
50
23
|
```
|
|
51
|
-
|
|
52
|
-
## Verification
|
|
53
|
-
|
|
54
|
-
`pnpm --filter @combos-fun/plugin-renderer-3d-img run build`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@combos-fun/plugin-renderer-3d-img",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "3D textured plane",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-3d-img.esm.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"three": "^0.172.0",
|
|
30
|
-
"@combos-fun/
|
|
31
|
-
"@combos-fun/
|
|
32
|
-
"@combos-fun/
|
|
30
|
+
"@combos-fun/engine": "0.1.16",
|
|
31
|
+
"@combos-fun/inspector-decorator": "0.1.16",
|
|
32
|
+
"@combos-fun/plugin-renderer-3d": "0.1.16"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"combos-fun",
|