課程Github:
https://github.com/QQBoxy/2018vc
Example 1 - Class Object
https://github.com/QQBoxy/2018vc/blob/master/classobject/main.cpp
XYZ三維座標系中,點A、點B、點C,連成一個三角形面,上面有一個法向量N
Example 2 - Class Inherit
https://github.com/QQBoxy/2018vc/blob/master/inherit/main.cpp
網格法向量求解:
http://www.iquilezles.org/www/articles/normals/normals.htm
Example 3 - bisection
https://github.com/QQBoxy/2015vc/blob/master/bisection/main.cpp
參考不使用遞迴:
http://codeboxy.blogspot.com/2014/07/bisection-method-using-recursion.html
誤差函式
1. x-2-x, 0≦x≦1
2. x4-2x3-4x2+4x+4, -2≦x≦-1
ios::boolalpha | 將真與假以true與false顯示 |
ios::dec | 10進位顯示 |
ios::fixed | 正常方式顯示(非科學記號) |
ios::hex | 16進位顯示 |
ios::left | 靠左 |
ios::oct | 8進位顯示 |
ios::scientific | 科學記號 |
ios::showbase | 顯示基底 |
ios::showpoint | 顯示小數點 |
ios::showpos | 正數顯示+ |
ios::skipws | 忽略空白字元 |
ios::uppercase | 字母大寫 |
FYI:
遞迴 (recursive) 函式之設計
http://squall.cs.ntou.edu.tw/cprog/materials/recursive.html
動態陣列Vector用法
http://ccuboxy.blogspot.com/2016/07/advanced-vc-chapter-3.html
使用迭代器匹配字串
http://codeboxy.blogspot.com/2014/07/regular-expression-iterator.html
作業:
請撰寫一支程式,能夠讀取網格資料(ASCII、Binary),使用Class技巧重用類別。
測試資料:
四角錐 2x2x2 (TriangleASCII.STL)
立方體 2x2x2 (CubeASCII.STL)
測試檔案:
球 (FileName: SphereASCII.STL, Facet Normal: 2352, Vertex: 7056, Diameter: 1mm)
https://sites.google.com/site/ccuboxy/home/SphereASCII.STL?attredirects=0&d=1
小齒輪 (FileName: GearASCII.STL, Facet Normal: 792, Vertex: 2376, Diameter: 10mm)
https://sites.google.com/site/ccuboxy/home/GearASCII.STL?attredirects=0&d=1
大齒輪 (FileName: LargeGearASCII.STL, Facet Normal: 792, Vertex: 2376, Diameter: 100mm)
https://sites.google.com/site/ccuboxy/home/LargeGearASCII.STL?attredirects=0&d=1
風扇 (FileName: FanASCII.STL, Facet Normal: 2928, Vertex: 8784, Diameter: 80mm)
https://sites.google.com/site/ccuboxy/home/FanASCII.STL?attredirects=0&d=1
沒有留言:
張貼留言