feat: add readme

This commit is contained in:
max_richter 2024-04-24 02:01:20 +02:00
parent f0ccbf808e
commit d82b798897
6 changed files with 35 additions and 11 deletions

3
README.md Normal file
View File

@ -0,0 +1,3 @@
Nodarium
Info tbd.

View File

@ -1,7 +1,17 @@
<script lang="ts"> <script lang="ts">
import { T } from "@threlte/core"; import { T } from "@threlte/core";
import { MeshLineGeometry, MeshLineMaterial, Text } from "@threlte/extras"; import {
import type { BufferGeometry, PerspectiveCamera, Vector3 } from "three"; MeshLineGeometry,
MeshLineMaterial,
Text,
useTexture,
} from "@threlte/extras";
import {
Texture,
type BufferGeometry,
type PerspectiveCamera,
type Vector3,
} from "three";
import type { OrbitControls as OrbitControlsType } from "three/addons/controls/OrbitControls.js"; import type { OrbitControls as OrbitControlsType } from "three/addons/controls/OrbitControls.js";
import { OrbitControls } from "@threlte/extras"; import { OrbitControls } from "@threlte/extras";
import { AppSettings } from "../settings/app-settings"; import { AppSettings } from "../settings/app-settings";
@ -14,6 +24,8 @@
export let camera: PerspectiveCamera; export let camera: PerspectiveCamera;
export let controls: OrbitControlsType; export let controls: OrbitControlsType;
const matcap = useTexture("/matcap_green.jpg");
const cameraTransform = localStore<{ camera: number[]; target: number[] }>( const cameraTransform = localStore<{ camera: number[]; target: number[] }>(
"nodes.camera.transform", "nodes.camera.transform",
{ {
@ -58,7 +70,7 @@
</T.PerspectiveCamera> </T.PerspectiveCamera>
<T.DirectionalLight position={[0, 10, 10]} /> <T.DirectionalLight position={[0, 10, 10]} />
<T.AmbientLight intensity={0.5} /> <T.AmbientLight intensity={2} />
{#each geometries as geo} {#each geometries as geo}
{#if $AppSettings.showIndices} {#if $AppSettings.showIndices}
@ -75,13 +87,18 @@
<T.PointsMaterial size={0.25} /> <T.PointsMaterial size={0.25} />
</T.Points> </T.Points>
{/if} {/if}
{#await matcap then value}
<T.Mesh geometry={geo}> <T.Mesh geometry={geo}>
<T.MeshMatcapMaterial matcap={value} />
{#if false}
<T.MeshStandardMaterial <T.MeshStandardMaterial
color="green" color="green"
depthTest={true} depthTest={true}
wireframe={$AppSettings.wireframe} wireframe={$AppSettings.wireframe}
/> />
{/if}
</T.Mesh> </T.Mesh>
{/await}
{/each} {/each}
{#if $AppSettings.showStemLines && lines} {#if $AppSettings.showStemLines && lines}

View File

@ -7,6 +7,9 @@ export const AppSettings = localStore("node-settings", {
snapToGrid: true, snapToGrid: true,
wireframes: false, wireframes: false,
showIndices: false, showIndices: false,
showVertices: false,
centerCamera: true,
showStemLines: false,
}); });
const themes = ["dark", "light", "catppuccin", "solarized", "high-contrast", "nord", "dracula"]; const themes = ["dark", "light", "catppuccin", "solarized", "high-contrast", "nord", "dracula"];

BIN
app/static/matcap_green.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -127,7 +127,7 @@ body.theme-nord {
--layer-3: #5E81AC; --layer-3: #5E81AC;
--active: #8999bd; --active: #8999bd;
--selected: #b76c3f; --selected: #b76c3f;
--connection: #232731; --connection: #4C566A;
} }
body.theme-dracula { body.theme-dracula {
@ -137,6 +137,7 @@ body.theme-dracula {
--layer-1: #44475A; --layer-1: #44475A;
--layer-2: #32374D; --layer-2: #32374D;
--layer-3: #BD93F9; --layer-3: #BD93F9;
--connection: #6272A4;
} }
body { body {

View File