Fix a broken link and a missing argument in tutorial9

pull/54/head
Hiroaki Yutani 4 years ago committed by GitHub
parent f163d92107
commit 55d47396a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -131,7 +131,7 @@ pub struct Mesh {
}
```
The `Material` is pretty simple, it's just the name and one texture. Our cube obj actually has 2 textures, but one is a normal map, and we'll get to those [later](./intermediate/normal-mapping). The name is more for debugging purposes.
The `Material` is pretty simple, it's just the name and one texture. Our cube obj actually has 2 textures, but one is a normal map, and we'll get to those [later](../../intermediate/normal-mapping). The name is more for debugging purposes.
`Mesh` holds a vertex buffer, an index buffer, and the number of indices in the mesh. We're using an `usize` for the material. This `usize` will be used to index the `materials` list when it comes time to draw.
@ -285,7 +285,11 @@ render_pass.draw_mesh_instanced(&self.obj_model.meshes[0], 0..self.instances.len
Before that though we need to actually load the model and save it to `State`. Put the following in `State::new()`.
```rust
let (obj_model, cmds) = model::Model::load(&device, "code/beginner/tutorial9-models/src/res/cube.obj").unwrap();
let (obj_model, cmds) = model::Model::load(
&device,
&texture_bind_group_layout,
"code/beginner/tutorial9-models/src/res/cube.obj",
).unwrap();
```
The path to the obj will be different for you, so keep that in mind.
@ -439,4 +443,4 @@ render_pass.set_pipeline(&self.render_pipeline);
render_pass.draw_model_instanced(&self.obj_model, 0..self.instances.len() as u32, &self.uniform_bind_group);
```
<AutoGithubLink/>
<AutoGithubLink/>

Loading…
Cancel
Save