-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec8d098
commit 2803c98
Showing
20 changed files
with
133 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"three-inspect": patch | ||
--- | ||
|
||
Fix exports for vanilla projects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
body, html { | ||
height: 100vh; | ||
margin: 0; | ||
font-family: system-ui; | ||
body, | ||
html { | ||
height: 100vh; | ||
margin: 0; | ||
font-family: system-ui; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
<script lang='ts'> | ||
import * as THREE from 'three' | ||
import { T } from '@threlte/core' | ||
import { Line2 } from 'three/examples/jsm/lines/Line2' | ||
import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry' | ||
import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial' | ||
<script lang="ts"> | ||
import * as THREE from 'three' | ||
import { T } from '@threlte/core' | ||
import { Line2 } from 'three/examples/jsm/lines/Line2' | ||
import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry' | ||
import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial' | ||
export let length = 1 | ||
export let width = 0.2 | ||
export let colors = ['red', 'green', 'blue'] | ||
export let length = 1 | ||
export let width = 0.2 | ||
export let colors = ['red', 'green', 'blue'] | ||
const lineGeometry = new LineGeometry() | ||
const lineMaterial = new LineMaterial({ | ||
alphaToCoverage: true, | ||
linewidth: width / 100, | ||
vertexColors: true, | ||
}) | ||
const line2 = new Line2(lineGeometry, lineMaterial) | ||
const color = new THREE.Color() | ||
const lineGeometry = new LineGeometry() | ||
const lineMaterial = new LineMaterial({ | ||
alphaToCoverage: true, | ||
linewidth: width / 100, | ||
vertexColors: true, | ||
}) | ||
const line2 = new Line2(lineGeometry, lineMaterial) | ||
const color = new THREE.Color() | ||
$: { | ||
const positions = new Float32Array(27) | ||
positions[3] = length | ||
positions[13] = length | ||
positions[23] = length | ||
lineGeometry.setPositions(positions) | ||
line2.computeLineDistances() | ||
} | ||
$: { | ||
const positions = new Float32Array(27) | ||
positions[3] = length | ||
positions[13] = length | ||
positions[23] = length | ||
lineGeometry.setPositions(positions) | ||
line2.computeLineDistances() | ||
} | ||
$: { | ||
lineMaterial.linewidth = width / 100 | ||
} | ||
$: { | ||
lineMaterial.linewidth = width / 100 | ||
} | ||
$: { | ||
const colorArray = new Float32Array(27) | ||
colors.forEach((axis, i) => { | ||
color.set(axis) | ||
for (let j = i * 9; j < (i * 9) + 9; j += 3) { | ||
colorArray[j + 0] = color.r | ||
colorArray[j + 1] = color.g | ||
colorArray[j + 2] = color.b | ||
} | ||
}) | ||
lineGeometry.setColors(colorArray) | ||
} | ||
$: { | ||
const colorArray = new Float32Array(27) | ||
colors.forEach((axis, i) => { | ||
color.set(axis) | ||
for (let j = i * 9; j < i * 9 + 9; j += 3) { | ||
colorArray[j + 0] = color.r | ||
colorArray[j + 1] = color.g | ||
colorArray[j + 2] = color.b | ||
} | ||
}) | ||
lineGeometry.setColors(colorArray) | ||
} | ||
</script> | ||
|
||
<T is={line2}> | ||
<T is={lineGeometry} /> | ||
<T is={lineMaterial} /> | ||
<T is={lineGeometry} /> | ||
<T is={lineMaterial} /> | ||
</T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<script> | ||
import '../app.css' | ||
import '../app.css' | ||
</script> | ||
|
||
<slot /> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.