Skip to content

Commit df18147

Browse files
chore: setup model editor
* wip * chore: fix PTU + texture * chore: draft asset loading --------- Co-authored-by: Pierre Demailly <pierredemailly.pro@gmail.com>
1 parent 21b7459 commit df18147

File tree

20 files changed

+2089
-24
lines changed

20 files changed

+2089
-24
lines changed

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"packages/client",
1818
"packages/fs-tree",
1919
"packages/editors/voxel-map",
20+
"packages/editors/model",
2021
"packages/engine"
2122
],
2223
"repository": {

packages/editors/model/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO

packages/editors/model/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Model Editor</title>
8+
<link rel="stylesheet" href="./public/main.css">
9+
</head>
10+
11+
<canvas tabindex="-1"></canvas>
12+
<script type="module" src="./src/index.ts"></script>
13+
14+
</html>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "@jolly-pixel/editor.model",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"scripts": {
6+
"prepublish": "rimraf ./dist && tsc -b",
7+
"dev": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview"
10+
},
11+
"keywords": [],
12+
"files": [
13+
"dist"
14+
],
15+
"dependencies": {
16+
"@jolly-pixel/engine": "^1.0.0",
17+
"three": "^0.178.0"
18+
},
19+
"devDependencies": {
20+
"@types/three": "^0.178.0"
21+
}
22+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
* {
2+
box-sizing: border-box;
3+
margin: 0;
4+
padding: 0;
5+
}
6+
7+
html,
8+
body {
9+
height: 100%;
10+
margin: 0;
11+
overflow: hidden;
12+
}
13+
14+
body {
15+
font-family: sans-serif;
16+
font-size: 14px;
17+
display: flex;
18+
flex-flow: column;
19+
background-color: #eee;
20+
}
21+
22+
a {
23+
color: #00f;
24+
}
25+
26+
a:hover {
27+
text-decoration: none;
28+
}
29+
30+
main {
31+
position: relative;
32+
background-color: #fff;
33+
border: 1px solid #888;
34+
flex: 1;
35+
margin: 20px !important;
36+
overflow-y: auto;
37+
}
38+
39+
canvas {
40+
flex: 1;
41+
outline: none;
42+
}
43+
44+
.stats {
45+
position: fixed;
46+
top: 0px;
47+
right: 0px;
48+
cursor: pointer;
49+
opacity: 0.9;
50+
z-index: 10000;
51+
}

packages/editors/model/public/models/Tiny_Witch.bbmodel

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Made in Blockbench 4.8.3
2+
newmtl m_b79db0ea-b243-3966-aa7c-203bc764a3c5
3+
map_Kd Tiny_Witch_Texture.png
4+
newmtl none

0 commit comments

Comments
 (0)