Summerize Chapter 2: 3D Models
This commit is contained in:
parent
dd39d514b5
commit
e5c0bba740
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Chapter 2: 3D Models
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
## Metal coordinate system
|
||||||
|
|
||||||
|
The book doesn't mention that The Metal NDC(Normalized Device Coordinate) system is the left-hand coordinate system.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
To show the train, this book modified the model file itself. It's not bad but I believe that the model file should be remained to original. Instead of changing y position to -1, we can modify the vertex shader code like below and get the same result.
|
||||||
|
|
||||||
|
```
|
||||||
|
vertex float4 vertex_main(const VertexIn vertex_in [[ stage_in ]]) {
|
||||||
|
float4 position = vertex_in.position;
|
||||||
|
position.y -= 1.0; // lower y position by -1
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
@ -13,6 +13,7 @@ You can also download the source code from [here](https://store.raywenderlich.co
|
||||||
## Summarize
|
## Summarize
|
||||||
|
|
||||||
* [Chapter 1: Hello, Metal!](https://github.com/daemyung/MetalByTutorials/tree/main/01-introduction-to-metal)
|
* [Chapter 1: Hello, Metal!](https://github.com/daemyung/MetalByTutorials/tree/main/01-introduction-to-metal)
|
||||||
|
* [Chapter 2: 3D Models](https://github.com/daemyung/MetalByTutorials/tree/main/02-3d-models)
|
||||||
|
|
||||||
## Copyright
|
## Copyright
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue