Summerize Chapter 9: The Scene Graph
This commit is contained in:
parent
de1fc918ab
commit
273aa3e0ec
|
|
@ -0,0 +1,39 @@
|
|||
# Chapter 9: The Scene Graph
|
||||
|
||||
As I read this book, I summarize what I think is wrong. If you think my comments are wrong then please let me know. We can dicuss more and update your opinion.
|
||||
|
||||
## The scene graph
|
||||
|
||||
* You can also remove the light when you cleanup your code. In `Scene.swift`, add this:
|
||||
|
||||
```
|
||||
var lighting = Lighting()
|
||||
```
|
||||
|
||||
In `Renderer.swift`, in `func draw(in view: MTKView)`, replace:
|
||||
|
||||
```
|
||||
var lights = lighting.lights
|
||||
```
|
||||
|
||||
With:
|
||||
|
||||
```
|
||||
var lights = scene.lighting.lights
|
||||
```
|
||||
|
||||
* If you remove a camera in 'Renderer', you need to update `override func scrollWheel(with event: NSEvent)` in `ViewControllerExtension.swift`, replace:
|
||||
|
||||
```
|
||||
override func scrollWheel(with event: NSEvent) {
|
||||
renderer?.camera.zoom(delta: Float(event.deltaY))
|
||||
}
|
||||
```
|
||||
|
||||
With:
|
||||
|
||||
```
|
||||
override func scrollWheel(with event: NSEvent) {
|
||||
renderer?.scene?.camera.zoom(delta: Float(event.deltaY))
|
||||
}
|
||||
```
|
||||
|
|
@ -23,6 +23,7 @@ You can see color images in this book at [here](https://www.raywenderlich.com/bo
|
|||
* [Chapter 5: Lighting Fundamentals](https://github.com/daemyung/MetalByTutorials/tree/main/05-lighting-fundamentals)
|
||||
* [Chapter 6: Textures](https://github.com/daemyung/MetalByTutorials/tree/main/06-textures)
|
||||
* [Chapter 8: Character Animation](https://github.com/daemyung/MetalByTutorials/tree/main/08-character-animation)
|
||||
* [Chapter 9: The Scene Graph](https://github.com/daemyung/MetalByTutorials/tree/main/09-scene-graph)
|
||||
|
||||
## Copyright
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue