Skip to content

Commit

Permalink
changed model for suzanne
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Jul 23, 2024
1 parent a0bca64 commit 0e94ba7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions rapier3d/build_typescript.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /bin/sh

mkdir -p ./pkg/src
cp -r ../src.ts/* pkg/src/.
rm -f ./pkg/raw.ts
Expand Down
1 change: 1 addition & 0 deletions testbed3d/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions testbed3d/src/demos/glbToTrimesh.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {Testbed} from "../Testbed";
import {Vector3, Object3D, Mesh, BufferGeometry, BufferAttribute} from "three";
import {GLTFLoader} from "three/examples/jsm/loaders/GLTFLoader";
import type { Testbed } from "../Testbed";
import { Vector3, Object3D, Mesh, BufferGeometry, BufferAttribute } from "three";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
type RAPIER_API = typeof import("@dimforge/rapier3d");

export function initWorld(RAPIER: RAPIER_API, testbed: Testbed) {
Expand All @@ -19,7 +19,7 @@ export function initWorld(RAPIER: RAPIER_API, testbed: Testbed) {

let loader = new GLTFLoader();

loader.load("./sword.glb", (gltf) => {
loader.load("./suzanne_blender_monkey.glb", (gltf) => {
gltf.scene.position.set(0, 1.2, 0);
gltf.scene.scale.set(3, 3, 3);
testbed.graphics.scene.add(gltf.scene);
Expand Down Expand Up @@ -61,8 +61,8 @@ export function initWorld(RAPIER: RAPIER_API, testbed: Testbed) {

testbed.setWorld(world);
let cameraPosition = {
eye: {x: 10.0, y: 5.0, z: 10.0},
target: {x: 0.0, y: 0.0, z: 0.0},
eye: { x: 10.0, y: 5.0, z: 10.0 },
target: { x: 0.0, y: 0.0, z: 0.0 },
};
testbed.lookAt(cameraPosition);
}
10 changes: 5 additions & 5 deletions testbed3d/src/demos/glbtoConvexHull.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {Testbed} from "../Testbed";
import type { Testbed } from "../Testbed";
import {
Vector3,
Object3D,
Expand All @@ -7,7 +7,7 @@ import {
BufferAttribute,
TriangleStripDrawMode,
} from "three";
import {GLTFLoader} from "three/examples/jsm/loaders/GLTFLoader";
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
type RAPIER_API = typeof import("@dimforge/rapier3d");

export function initWorld(RAPIER: RAPIER_API, testbed: Testbed) {
Expand All @@ -24,7 +24,7 @@ export function initWorld(RAPIER: RAPIER_API, testbed: Testbed) {

let loader = new GLTFLoader();

loader.load("./sword.glb", (gltf) => {
loader.load("./suzanne_blender_monkey.glb", (gltf) => {
gltf.scene.position.set(0, 1.2, 0);
gltf.scene.scale.set(3, 3, 3);
testbed.graphics.scene.add(gltf.scene);
Expand Down Expand Up @@ -61,8 +61,8 @@ export function initWorld(RAPIER: RAPIER_API, testbed: Testbed) {

testbed.setWorld(world);
let cameraPosition = {
eye: {x: 10.0, y: 5.0, z: 10.0},
target: {x: 0.0, y: 0.0, z: 0.0},
eye: { x: 10.0, y: 5.0, z: 10.0 },
target: { x: 0.0, y: 0.0, z: 0.0 },
};
testbed.lookAt(cameraPosition);
}
Binary file added testbed3d/static/suzanne_blender_monkey.glb
Binary file not shown.
Binary file removed testbed3d/static/sword.glb
Binary file not shown.

0 comments on commit 0e94ba7

Please sign in to comment.