๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ48

STL set class set์€ ์›ํ•˜๋Š” key๋ฅผ ์‹ ์†ํ•˜๊ฒŒ ์ฐพ๊ณ , ์ด key๊ฐ€ ์ž๋™์œผ๋กœ ์ •๋ ฌ๋˜๊ธฐ๋ฅผ ์›ํ• ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค. map๊ณผ๋Š” ๋‹ฌ๋ฆฌ key-value pair๋กœ ์ €์žฅ๋˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ key๋งŒ ์ €์žฅ๋œ๋‹ค. 1. ์ž๋™ ์ •๋ ฌ 2. key๊ฐ€ ์žˆ๋Š”์ง€ ์—†๋Š”์ง€ ์•Œ์•„์•ผ ํ•  ๋•Œ 3. ๋งŽ์€ ์ž๋ฃŒ๋ฅผ ์ €์žฅํ•˜๊ณ , ๊ฒ€์ƒ‰ ์†๋„๊ฐ€ ๋นจ๋ผ์•ผ ํ•  ๋•Œ #include set set1; // ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌ set set1; // ๋‚ด๋ฆผ์ฐจ์ˆœ ์ •๋ ฌ set ์ฃผ์š” ๋ฉค๋ฒ„ begin: ์ฒซ ๋ฒˆ์งธ ์›์†Œ์˜ ๋žœ๋ค ์ ‘๊ทผ ๋ฐ˜๋ณต์ž๋ฅผ ๋ฐ˜ํ™˜ clear: ์ €์žฅํ•˜๊ณ  ์žˆ๋Š” ๋ชจ๋“  ์›์†Œ๋ฅผ ์‚ญ์ œ empty: ์ €์žฅํ•˜๊ณ  ์žˆ๋Š” ์š”์†Œ๊ฐ€ ์—†์œผ๋ฉด true ๋ฐ˜ํ™˜ end: ๋งˆ์ง€๋ง‰ ์›์†Œ ๋‹ค์Œ์˜(๋ฏธ ์‚ฌ์šฉ ์˜์—ญ) ๋ฐ˜๋ณต์ž๋ฅผ ๋ฐ˜ํ™˜ erase: ํŠน์ • ์œ„์น˜์˜ ์›์†Œ๋‚˜ ์ง€์ • ๋ฒ”์œ„์˜ ์›์†Œ๋“ค์„ ์‚ญ์ œ fine: key์™€ ์—ฐ๊ด€๋œ .. 2015. 3. 25.
STL map class map 1. ์ž๋™ ์ •๋ ฌ 2. ๋งŽ์€ ์ž๋ฃŒ๋ฅผ ์ €์žฅ, ๊ฒ€์ƒ‰์ด ๋นจ๋ผ์•ผ ํ•จ 3. ๋นˆ๋ฒˆํ•˜๊ฒŒ ์‚ฝ์ž…/์‚ญ์ œ๋ฅผ ํ•˜์ง€ ์•Š์Œ #include map map1; // key๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์˜ค๋ฆ„์ฐจ์ˆœ์œผ๋กœ ์ •๋ ฌ map map1; // ๋‚ด๋ฆผ์ฐจ์ˆœ ์ •๋ ฌ map ์ฃผ์š” ๋ฉค๋ฒ„ begin: ์ฒซ๋ฒˆ์งธ ์›์†Œ์˜ ๋žœ๋ค ์ ‘๊ทผ ๋ฐ˜๋ณต์ž๋ฅผ ๋ฐ˜ํ™˜ clear: ์ €์žฅํ•˜๊ณ  ์žˆ๋Š” ๋ชจ๋“  ์›์†Œ ์‚ญ์ œ empty: ์ €์žฅํ•˜๊ณ  ์žˆ๋Š” ์š”์†Œ๊ฐ€ ์—†์œผ๋ฉด true ๋ฐ˜ํ™˜ end: ๋งˆ์ง€๋ง‰ ์›์†Œ ๋‹ค์Œ์˜(๋ฏธ ์‚ฌ์šฉ ์˜์—ญ) ๋ฐ˜๋ณต์ž๋ฅผ ๋ฐ˜ํ™˜ erase: ํŠน์ • ์œ„์น˜์˜ ์›์†Œ๋‚˜ ์ง€์ • ๋ฒ”์œ„์˜ ์›์†Œ๋“ค์„ ์‚ญ์ œ find: ํ•ด๋‹น key์™€ ์—ฐ๊ด€๋œ ์›์†Œ์˜ ๋ฐ˜๋ณต์ž ๋ฐ˜ํ™˜ insert: ์›์†Œ ์ถ”๊ฐ€ lower_bound: ์ง€์ •ํ•œ key ์š”์†Œ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค๋ฉด ํ•ด๋‹น ์œ„์น˜์˜ ๋ฐ˜๋ณต์ž ๋ฐ˜ํ™˜ operator[]: ์ง€์ •ํ•œ key ๊ฐ’์œผ๋กœ ์›์†Œ .. 2015. 3. 25.
[tbd] Deformation Transfer for Triangle Meshes (2004) Deformation Transfer : 3 steps 1. Establish triangle correspondence. 2. Represent source deformation with per-triangle affine transformations. 3. Apply source transformations to target by solving optimization problem. 1. Triangle correspondence Target triangle mesh transform "like" the source mesh. Source์™€ target์˜ mesh๊ฐ€ ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์— ์ผ๋Œ€๋‹ค/๋‹ค๋Œ€์ผ์˜ ๋งค์น˜๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค. ํŠน์ • ํฌ์ธํŠธ๋ฅผ ์ฐ์–ด source์—์„œ target์œผ๋กœ์˜ iterative transform.. 2015. 3. 23.
[tbd] ๋ณ€ํ™˜ํ–‰๋ ฌ Transformation Matrix https://open.gl/transformations Translation Scaling Rotation – rotation about y-axis is heading/yaw – rotation about x-axis is pitch/elevation – rotation about z-axis is roll/bank Combining transformations is demonstrated by the multiplication of matrices. ex) Mtranslate * Mscale Transformations in OpenGL Model Matrix Ojbect coordinates (position in model) -> World coordinates (position in world.. 2015. 3. 23.