Summerize Chapter 2: 3D Models

This commit is contained in:
daemyung jang 2021-04-19 19:19:02 +09:00
parent dd39d514b5
commit e5c0bba740
2 changed files with 20 additions and 0 deletions

19
02-3d-models/README.md Normal file
View File

@ -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.
![](https://upload.wikimedia.org/wikipedia/commons/b/b2/3D_Cartesian_Coodinate_Handedness.jpg)
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;
}
```

View File

@ -13,6 +13,7 @@ You can also download the source code from [here](https://store.raywenderlich.co
## Summarize
* [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