Skip to content

Commit 8e8d6ff

Browse files
committed
improve lookbook
1 parent ef2fb92 commit 8e8d6ff

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed
Loading

apps/lookbook/src/pages/demos/textured-quads-from-tileset.astro

+14-14
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {title} from './_textured-quads-from-tileset.json';
1818
}
1919
body {
2020
background-color: #391e39;
21-
background: radial-gradient(circle, rgba(189, 70, 98, 1) 0%, rgba(37, 4, 73, 1) 100%);
21+
background: radial-gradient(circle, rgba(109 80 87) 0%, rgba(21 2 41) 100%);
2222
}
2323
.texture-preview {
2424
background-color: rgba(86, 101, 115, 80%);
@@ -60,9 +60,9 @@ import {title} from './_textured-quads-from-tileset.json';
6060
<script>
6161
import {TileSet, TileSetLoader, VertexObjects} from '@spearwolf/twopoint5d';
6262
import {DoubleSide, RawShaderMaterial, Texture} from 'three';
63+
import {InstancedQuadsGeometry} from '~demos/instanced-quads/InstancedQuadsGeometry';
6364
import fragmentShaderSource from '~demos/shaders/textured-quads.frag?url';
6465
import vertexShaderSource from '~demos/shaders/textured-quads.vert?url';
65-
import {InstancedQuadsGeometry} from '~demos/instanced-quads/InstancedQuadsGeometry';
6666
import {PerspectiveOrbitDemo} from '~demos/utils/PerspectiveOrbitDemo';
6767
import assetsUrl from '~demos/utils/assetsUrl';
6868
import loadShaderSource from '~demos/utils/loadShaderSource';
@@ -87,6 +87,7 @@ import {title} from './_textured-quads-from-tileset.json';
8787
]);
8888

8989
const texCoords = tileset.atlas.randomFrame().coords;
90+
console.log('texCoords', [texCoords.s, texCoords.t, texCoords.u, texCoords.v]);
9091
quad.setTexCoords([texCoords.s, texCoords.t, texCoords.u, texCoords.v]);
9192
}
9293
}
@@ -112,21 +113,20 @@ import {title} from './_textured-quads-from-tileset.json';
112113

113114
const demo = new PerspectiveOrbitDemo(document.getElementById('canvas-container'), {antialias: false});
114115

115-
const {imgEl, texture, tileSet} = await new TileSetLoader().loadAsync(
116-
assetsUrl('nobinger-anim-sheet.png'),
117-
{
118-
tileWidth: 64,
119-
tileHeight: 64,
120-
margin: 1,
121-
},
122-
['nearest'],
123-
);
116+
await demo.start(async () => {
117+
const {imgEl, texture, tileSet} = await new TileSetLoader().loadAsync(
118+
assetsUrl('glaskugeln-2-256x.png'),
119+
{
120+
tileWidth: 256,
121+
tileHeight: 256,
122+
},
123+
['nearest'],
124+
);
124125

125-
console.log('loaded tileset', {imgEl, tileSet, texture});
126+
console.log('loaded tileset', {imgEl, tileSet, texture});
126127

127-
document.getElementById('texture-preview').appendChild(imgEl);
128+
document.getElementById('texture-preview').appendChild(imgEl.cloneNode());
128129

129-
await demo.start(async () => {
130130
demo.scene.add(await makeMesh(16, 32, 3.5, 1, tileSet, texture));
131131
});
132132

0 commit comments

Comments
 (0)