#Loading a mesh through a pbrbundle

8 messages · Page 1 of 1 (latest)

cedar rock
#

I have the following code as part of:
`
command.spawn(

PbrBundle {
    mesh: ass.load("meshes/diff_bot-BodyBase.gltf#Scene0"), 
    material: materials.add(Color::rgb(0.8, 0.7, 0.6).into()),
    transform: Transform::from_xyz(0.0, 20.0, 0.0),
    ..default()
},

);
`
the mesh doesn't load though. What am I missing?

frosty mauve
#

Try #Mesh0/Primitive0 instead of #Scene0 :)

cedar rock
frosty mauve
#

Is it in front of your camera? 20.0 units is fairly high up

Or maybe it'll show up when spawned as a scene

commands.spawn(SceneBundle {
    scene: ass.load("meshes/diff_bot-BodyBase.gltf#Scene0"),
    ..default()
});
cedar rock
frosty mauve
#

The file contains multiple primitives. The scene will load them all as separate entities.
Maybe try some other primitive (e.g. Primitive1)

cedar rock
#

ahh, I've not use gltf before. Anyway, I think im going to stick to the SceneBundle for loading meshes for sanity... It doesn't break rapier physics to use that instead.