Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/troika-text
- Loading branch information
Showing
36 changed files
with
2,662 additions
and
959 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+340 KB
.storybook/public/textures/grassy_cobble/grassy_cobblestone_diff_2k.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+548 KB
.storybook/public/textures/grassy_cobble/grassy_cobblestone_nor_gl_2k.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+137 KB
.storybook/public/textures/grassy_cobble/grassy_cobblestone_rough_2k.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,39 @@ | ||
import * as React from 'react' | ||
import { Box, OrbitControls, Html, ScreenSpace } from '../../src' | ||
import { Vector3 } from 'three' | ||
|
||
import { Setup } from '../Setup' | ||
|
||
export default { | ||
title: 'Abstractions/ScreenSpace', | ||
component: ScreenSpace, | ||
decorators: [ | ||
(storyFn) => ( | ||
<Setup controls={false} cameraPosition={new Vector3(0, 0, 10)}> | ||
{storyFn()} | ||
</Setup> | ||
), | ||
], | ||
} | ||
|
||
export const ScreenSpaceStory = ({ depth }) => ( | ||
<> | ||
<Box args={[1, 1, 1]}> | ||
<meshPhysicalMaterial /> | ||
</Box> | ||
<ScreenSpace depth={depth}> | ||
<Box args={[0.1, 0.1, 0.1]} position={[0.5, 0.1, 0]}> | ||
<meshPhysicalMaterial color={'blue'} /> | ||
<Html center sprite> | ||
<div style={{ color: 'hotpink' }}>Hi i'm in screen space</div> | ||
</Html> | ||
</Box> | ||
</ScreenSpace> | ||
|
||
<OrbitControls enablePan={true} zoomSpeed={0.5} /> | ||
</> | ||
) | ||
|
||
ScreenSpaceStory.args = { | ||
depth: 1, | ||
} |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as React from 'react' | ||
import { withKnobs, number } from '@storybook/addon-knobs' | ||
|
||
import { Setup } from '../Setup' | ||
|
||
import { useTrailTexture } from '../../src' | ||
|
||
export default { | ||
title: 'misc/useTrailTexture', | ||
component: useTrailTexture, | ||
decorators: [withKnobs, (storyFn) => <Setup>{storyFn()}</Setup>], | ||
} | ||
|
||
function TrailMesh() { | ||
// a convenience hook that uses useLoader and TextureLoader | ||
const [texture, onMove] = useTrailTexture({ | ||
size: number('Size', 256, { min: 64, step: 8 }), | ||
radius: number('Radius', 0.3, { range: true, min: 0.1, max: 1, step: 0.1 }), | ||
maxAge: number('Max age', 750, { range: true, min: 300, max: 1000, step: 100 }), | ||
}) | ||
|
||
return ( | ||
<mesh scale={7} onPointerMove={onMove}> | ||
<planeGeometry /> | ||
<meshBasicMaterial map={texture} /> | ||
</mesh> | ||
) | ||
} | ||
|
||
function UseTrailTextureScene() { | ||
return ( | ||
<React.Suspense fallback={null}> | ||
<TrailMesh /> | ||
</React.Suspense> | ||
) | ||
} | ||
|
||
export const UseTextureSceneSt = () => <UseTrailTextureScene /> | ||
UseTextureSceneSt.story = { | ||
name: 'Default', | ||
} |
Oops, something went wrong.