mirror of
https://github.com/TomHodson/tomhodson.github.com.git
synced 2025-06-26 10:01:18 +02:00
add DRACO loader and mastodon posts
This commit is contained in:
parent
0cae30d4a6
commit
ac24238f09
4
_includes/mastodon_post.html
Normal file
4
_includes/mastodon_post.html
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<figure class="centered">
|
||||||
|
<iframe src="https://tech.lgbt/@Tomhodson/{{include.post_id}}/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400" allowfullscreen="allowfullscreen"></iframe>
|
||||||
|
<script src="https://tech.lgbt/embed.js" async="async"></script>
|
||||||
|
</figure>
|
33
_projects/bathroom_shelf.md
Normal file
33
_projects/bathroom_shelf.md
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
title: Bathroom Shelf
|
||||||
|
layout: post
|
||||||
|
excerpt: A little modification to an IKEA thingy.
|
||||||
|
permalink: /projects/bathroom_shelf
|
||||||
|
|
||||||
|
img:
|
||||||
|
src:
|
||||||
|
alt:
|
||||||
|
class: invertable
|
||||||
|
|
||||||
|
social_image:
|
||||||
|
model:
|
||||||
|
|
||||||
|
head: |
|
||||||
|
<script async src="/node_modules/es-module-shims/dist/es-module-shims.js"></script>
|
||||||
|
<script type="importmap">
|
||||||
|
{
|
||||||
|
"imports": {
|
||||||
|
"three": "/node_modules/three/build/three.module.min.js",
|
||||||
|
"three/addons/": "/node_modules/three/examples/jsm/",
|
||||||
|
"lil-gui": "/node_modules/lil-gui/dist/lil-gui.esm.min.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script src="/assets/js/outline-model-viewer/index.js" type="module"></script>
|
||||||
|
---
|
||||||
|
<outline-model-viewer model = "/assets/projects/bathroom_shelf/models/ikea.glb" zoom=845>
|
||||||
|
<img class="outline-model-poster no-wc" src = "/assets/projects/bike_lights/thumbnail.svg">
|
||||||
|
<p class="has-wc">Loading model...</p>
|
||||||
|
</outline-model-viewer>
|
||||||
|
|
||||||
|
{% include mastodon_post.html post_id = "111822564173512216" %}
|
30
_projects/usbc_power_station.md
Normal file
30
_projects/usbc_power_station.md
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
title: USB-C Power Station
|
||||||
|
layout: post
|
||||||
|
excerpt: One charging station to rule them all!
|
||||||
|
permalink: /projects/usbc_charging_station
|
||||||
|
|
||||||
|
img:
|
||||||
|
src:
|
||||||
|
alt:
|
||||||
|
class: invertable
|
||||||
|
|
||||||
|
social_image:
|
||||||
|
model:
|
||||||
|
|
||||||
|
head: |
|
||||||
|
<script async src="/node_modules/es-module-shims/dist/es-module-shims.js"></script>
|
||||||
|
<script type="importmap">
|
||||||
|
{
|
||||||
|
"imports": {
|
||||||
|
"three": "/node_modules/three/build/three.module.min.js",
|
||||||
|
"three/addons/": "/node_modules/three/examples/jsm/",
|
||||||
|
"lil-gui": "/node_modules/lil-gui/dist/lil-gui.esm.min.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script src="/assets/js/outline-model-viewer/index.js" type="module"></script>
|
||||||
|
---
|
||||||
|
|
||||||
|
{% include mastodon_post.html post_id = "111813225328398667" %}
|
||||||
|
{% include mastodon_post.html post_id = "111816310882560850" %}
|
@ -120,6 +120,11 @@ figure > img, figure > svg, figure > canvas {
|
|||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
figure.centered {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
// For fallback images inside custom outline-model-viewer elements
|
// For fallback images inside custom outline-model-viewer elements
|
||||||
.outline-model-poster {
|
.outline-model-poster {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
.mastodon-embed {
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.comments {
|
.comments {
|
||||||
.comment .avatar {
|
.comment .avatar {
|
||||||
float: left;
|
float: left;
|
||||||
|
@ -7,6 +7,11 @@ article.project {
|
|||||||
|
|
||||||
h2 {margin-top: 0;}
|
h2 {margin-top: 0;}
|
||||||
|
|
||||||
|
a.photo {
|
||||||
|
width: 7em;
|
||||||
|
height: 7em;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
max-height: 7em;
|
max-height: 7em;
|
||||||
width: unset;
|
width: unset;
|
||||||
|
@ -3,6 +3,7 @@ import * as THREE from "three";
|
|||||||
// import * as dat from 'dat.gui';
|
// import * as dat from 'dat.gui';
|
||||||
|
|
||||||
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
|
||||||
|
import { DRACOLoader } from "three/addons/loaders/DRACOLoader.js";
|
||||||
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
||||||
import { EffectComposer } from "three/addons/postprocessing/EffectComposer.js";
|
import { EffectComposer } from "three/addons/postprocessing/EffectComposer.js";
|
||||||
import { RenderPass } from "three/addons/postprocessing/RenderPass.js";
|
import { RenderPass } from "three/addons/postprocessing/RenderPass.js";
|
||||||
@ -119,6 +120,11 @@ class OutlineModelViewer extends HTMLElement {
|
|||||||
const surfaceFinder = new FindSurfaces();
|
const surfaceFinder = new FindSurfaces();
|
||||||
// Load model
|
// Load model
|
||||||
const loader = new GLTFLoader();
|
const loader = new GLTFLoader();
|
||||||
|
const dracoLoader = new DRACOLoader();
|
||||||
|
dracoLoader.setDecoderConfig({ type: 'js' });
|
||||||
|
dracoLoader.setDecoderPath('https://www.gstatic.com/draco/v1/decoders/');
|
||||||
|
loader.setDRACOLoader( dracoLoader );
|
||||||
|
|
||||||
loader.load(model_path, (gltf) => {
|
loader.load(model_path, (gltf) => {
|
||||||
scene.add(gltf.scene);
|
scene.add(gltf.scene);
|
||||||
surfaceFinder.surfaceId = 0;
|
surfaceFinder.surfaceId = 0;
|
||||||
|
BIN
assets/projects/bathroom_shelf/models/ikea.glb
Normal file
BIN
assets/projects/bathroom_shelf/models/ikea.glb
Normal file
Binary file not shown.
@ -13,7 +13,7 @@ social_image: /assets/projects/lego_adapters/thumbnail.png
|
|||||||
---
|
---
|
||||||
{% for post in site.projects %}
|
{% for post in site.projects %}
|
||||||
<article class="h-entry project">
|
<article class="h-entry project">
|
||||||
<a class="u-uid u-url" href="{{ post.url }}">
|
<a class="u-uid u-url photo" href="{{ post.url }}">
|
||||||
<img class="u-photo {{post.img.class}}" src = "{{post.img.src}}" alt="{{post.img.alt}}">
|
<img class="u-photo {{post.img.class}}" src = "{{post.img.src}}" alt="{{post.img.alt}}">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user