@chocozhang/three-model-render 1.0.1 → 1.0.2
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 +21 -21
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -23,17 +23,17 @@ A high-performance, TypeScript-first toolkit providing 14 optimized utilities fo
|
|
|
23
23
|
|
|
24
24
|
### Using npm
|
|
25
25
|
```bash
|
|
26
|
-
npm install three-model-render
|
|
26
|
+
npm install @chocozhang/three-model-render
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
### Using yarn
|
|
30
30
|
```bash
|
|
31
|
-
yarn add three-model-render
|
|
31
|
+
yarn add @chocozhang/three-model-render
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
### Using pnpm
|
|
35
35
|
```bash
|
|
36
|
-
pnpm add three-model-render
|
|
36
|
+
pnpm add @chocozhang/three-model-render
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
**Peer Dependencies:**
|
|
@@ -47,7 +47,7 @@ npm install three@^0.160.0
|
|
|
47
47
|
|
|
48
48
|
### Import全量 (Supports Tree-shaking)
|
|
49
49
|
```typescript
|
|
50
|
-
import { followModels, addChildModelLabels, enableHoverBreath } from 'three-model-render'
|
|
50
|
+
import { followModels, addChildModelLabels, enableHoverBreath } from '@chocozhang/three-model-render'
|
|
51
51
|
|
|
52
52
|
// Use the utilities
|
|
53
53
|
followModels(camera, model, {
|
|
@@ -59,9 +59,9 @@ followModels(camera, model, {
|
|
|
59
59
|
### Import按需 (Recommended)
|
|
60
60
|
```typescript
|
|
61
61
|
// Only import what you need
|
|
62
|
-
import { followModels } from 'three-model-render/camera'
|
|
63
|
-
import { addChildModelLabels } from 'three-model-render/core'
|
|
64
|
-
import { enableHoverBreath } from 'three-model-render/core'
|
|
62
|
+
import { followModels } from '@chocozhang/three-model-render/camera'
|
|
63
|
+
import { addChildModelLabels } from '@chocozhang/three-model-render/core'
|
|
64
|
+
import { enableHoverBreath } from '@chocozhang/three-model-render/core'
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
---
|
|
@@ -125,7 +125,7 @@ Add floating 3D labels to model children with automatic position tracking.
|
|
|
125
125
|
|
|
126
126
|
**Usage:**
|
|
127
127
|
```typescript
|
|
128
|
-
import { addChildModelLabels } from 'three-model-render/core'
|
|
128
|
+
import { addChildModelLabels } from '@chocozhang/three-model-render/core'
|
|
129
129
|
|
|
130
130
|
const labelManager = addChildModelLabels(camera, renderer, model, {
|
|
131
131
|
'part1': 'Component 1',
|
|
@@ -170,7 +170,7 @@ Breathing outline effect on hover with intelligent performance optimization.
|
|
|
170
170
|
|
|
171
171
|
**Usage:**
|
|
172
172
|
```typescript
|
|
173
|
-
import { enableHoverBreath } from 'three-model-render/core'
|
|
173
|
+
import { enableHoverBreath } from '@chocozhang/three-model-render/core'
|
|
174
174
|
|
|
175
175
|
const hoverEffect = enableHoverBreath({
|
|
176
176
|
camera,
|
|
@@ -201,7 +201,7 @@ Initialize post-processing with resize handling and performance options.
|
|
|
201
201
|
|
|
202
202
|
**Usage:**
|
|
203
203
|
```typescript
|
|
204
|
-
import { initPostProcessing } from 'three-model-render/core'
|
|
204
|
+
import { initPostProcessing } from '@chocozhang/three-model-render/core'
|
|
205
205
|
|
|
206
206
|
const ppManager = initPostProcessing(renderer, scene, camera, {
|
|
207
207
|
resolutionScale: 0.8, // 80% resolution for better performance
|
|
@@ -233,7 +233,7 @@ Smoothly move camera to focus on target objects with easing animations.
|
|
|
233
233
|
|
|
234
234
|
**Usage:**
|
|
235
235
|
```typescript
|
|
236
|
-
import { followModels, cancelFollow } from 'three-model-render/camera'
|
|
236
|
+
import { followModels, cancelFollow } from '@chocozhang/three-model-render/camera'
|
|
237
237
|
|
|
238
238
|
await followModels(camera, targetMesh, {
|
|
239
239
|
easing: 'easeInOut', // 'linear' | 'easeIn' | 'easeOut' | 'easeInOut'
|
|
@@ -251,7 +251,7 @@ cancelFollow(camera)
|
|
|
251
251
|
|
|
252
252
|
**Preset Angles:**
|
|
253
253
|
```typescript
|
|
254
|
-
import { FOLLOW_ANGLES } from 'three-model-render/camera'
|
|
254
|
+
import { FOLLOW_ANGLES } from '@chocozhang/three-model-render/camera'
|
|
255
255
|
|
|
256
256
|
followModels(camera, model, {
|
|
257
257
|
...FOLLOW_ANGLES.ISOMETRIC // 45° diagonal view
|
|
@@ -266,7 +266,7 @@ Quick view switching with smooth animations.
|
|
|
266
266
|
|
|
267
267
|
**Usage:**
|
|
268
268
|
```typescript
|
|
269
|
-
import { setView, ViewPresets } from 'three-model-render/camera'
|
|
269
|
+
import { setView, ViewPresets } from '@chocozhang/three-model-render/camera'
|
|
270
270
|
|
|
271
271
|
// Programmatic view
|
|
272
272
|
await setView(camera, controls, model, 'front', {
|
|
@@ -302,7 +302,7 @@ Universal model loader supporting multiple formats.
|
|
|
302
302
|
|
|
303
303
|
**Usage:**
|
|
304
304
|
```typescript
|
|
305
|
-
import { loadModelByUrl } from 'three-model-render/loader'
|
|
305
|
+
import { loadModelByUrl } from '@chocozhang/three-model-render/loader'
|
|
306
306
|
|
|
307
307
|
const model = await loadModelByUrl('/path/to/model.fbx', {
|
|
308
308
|
mergeGeometries: false,
|
|
@@ -333,7 +333,7 @@ Global singleton for managing HDR/EXR environment maps.
|
|
|
333
333
|
|
|
334
334
|
**Usage:**
|
|
335
335
|
```typescript
|
|
336
|
-
import { BlueSky } from 'three-model-render/loader'
|
|
336
|
+
import { BlueSky } from '@chocozhang/three-model-render/loader'
|
|
337
337
|
|
|
338
338
|
// Initialize
|
|
339
339
|
BlueSky.init(renderer, scene, 1.0)
|
|
@@ -372,7 +372,7 @@ Create labels with connection lines and animations.
|
|
|
372
372
|
|
|
373
373
|
**Usage:**
|
|
374
374
|
```typescript
|
|
375
|
-
import { createModelsLabel } from 'three-model-render/ui'
|
|
375
|
+
import { createModelsLabel } from '@chocozhang/three-model-render/ui'
|
|
376
376
|
|
|
377
377
|
const labelMgr = createModelsLabel(camera, renderer, model, {
|
|
378
378
|
'mesh1': 'Part A',
|
|
@@ -403,7 +403,7 @@ Model explosion effects with multiple arrangement modes.
|
|
|
403
403
|
|
|
404
404
|
**Usage:**
|
|
405
405
|
```typescript
|
|
406
|
-
import { GroupExploder } from 'three-model-render/effect'
|
|
406
|
+
import { GroupExploder } from '@chocozhang/three-model-render/effect'
|
|
407
407
|
|
|
408
408
|
const exploder = new GroupExploder(scene, camera, controls)
|
|
409
409
|
exploder.init()
|
|
@@ -445,7 +445,7 @@ Automatically setup camera and lighting for a model.
|
|
|
445
445
|
|
|
446
446
|
**Usage:**
|
|
447
447
|
```typescript
|
|
448
|
-
import { autoSetupCameraAndLight } from 'three-model-render/setup'
|
|
448
|
+
import { autoSetupCameraAndLight } from '@chocozhang/three-model-render/setup'
|
|
449
449
|
|
|
450
450
|
const handle = autoSetupCameraAndLight(camera, scene, model, {
|
|
451
451
|
enableShadows: true,
|
|
@@ -493,8 +493,8 @@ onUnmounted(() => {
|
|
|
493
493
|
### React
|
|
494
494
|
```tsx
|
|
495
495
|
import { useEffect } from 'react'
|
|
496
|
-
import { followModels } from 'three-model-render/camera'
|
|
497
|
-
import { addChildModelLabels } from 'three-model-render/core'
|
|
496
|
+
import { followModels } from '@chocozhang/three-model-render/camera'
|
|
497
|
+
import { addChildModelLabels } from '@chocozhang/three-model-render/core'
|
|
498
498
|
|
|
499
499
|
function ModelViewer() {
|
|
500
500
|
useEffect(() => {
|
|
@@ -525,7 +525,7 @@ import type {
|
|
|
525
525
|
PostProcessingManager,
|
|
526
526
|
FollowOptions,
|
|
527
527
|
ExplodeOptions
|
|
528
|
-
} from 'three-model-render'
|
|
528
|
+
} from '@chocozhang/three-model-render'
|
|
529
529
|
```
|
|
530
530
|
|
|
531
531
|
---
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
package/dist/core/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { GammaCorrectionShader } from 'three/examples/jsm/shaders/GammaCorrectio
|
|
|
6
6
|
import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* 给 FBX 子模型添加头顶标签(支持 Mesh 和 Group)- 优化版
|
|
10
10
|
*
|
|
11
11
|
* ✨ 性能优化:
|
|
12
12
|
* - 缓存包围盒,避免每帧重复计算
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var THREE__namespace = /*#__PURE__*/_interopNamespaceDefault(THREE);
|
|
|
30
30
|
var BufferGeometryUtils__namespace = /*#__PURE__*/_interopNamespaceDefault(BufferGeometryUtils);
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* 给 FBX 子模型添加头顶标签(支持 Mesh 和 Group)- 优化版
|
|
34
34
|
*
|
|
35
35
|
* ✨ 性能优化:
|
|
36
36
|
* - 缓存包围盒,避免每帧重复计算
|
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUti
|
|
|
8
8
|
import { EXRLoader } from 'three/examples/jsm/loaders/EXRLoader.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* 给 FBX 子模型添加头顶标签(支持 Mesh 和 Group)- 优化版
|
|
12
12
|
*
|
|
13
13
|
* ✨ 性能优化:
|
|
14
14
|
* - 缓存包围盒,避免每帧重复计算
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chocozhang/three-model-render",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Professional Three.js model visualization and interaction toolkit with 14 high-performance utilities",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"typescript",
|
|
69
69
|
"performance"
|
|
70
70
|
],
|
|
71
|
-
"author": "
|
|
71
|
+
"author": "Danny Zhang <happyelement.danny@gmail.com>",
|
|
72
72
|
"license": "MIT",
|
|
73
73
|
"repository": {
|
|
74
74
|
"type": "git",
|
|
75
|
-
"url": "https://github.com/
|
|
75
|
+
"url": "https://github.com/HappyColour/three-model-render.git"
|
|
76
76
|
},
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
@@ -95,4 +95,4 @@
|
|
|
95
95
|
"prepublishOnly": "npm run build",
|
|
96
96
|
"type-check": "tsc --noEmit"
|
|
97
97
|
}
|
|
98
|
-
}
|
|
98
|
+
}
|