본문 바로가기

scale4

[그래픽스] 투영 행렬, Look-At 행렬, GLSL 변환 행렬 함수 (Projection Matrices, Look-At Matrices, GLSL Functions for Transformation Matrices) * 이 게시물은 Computer Graphics Programming in OpenGL with C++ 책의 일부를 번역 및 재해석한 게시물입니다. 의역 또는 오역이 있을 수 있으니 참고하시고, 피드백은 댓글을 남겨주세요. 투영 행렬 (Projection Matrices) 우리가 카메라를 설치하였기 때문에, 프로젝션 행렬을 검토할 수 있습니다. 우리가 이제 검토할 두 가지 중요한 프로젝션 행렬은 원근(perspective)과 직교(orthographic)입니다. 1. 원근 투영 행렬 (Perspective Projection Matrices) 원근 투영은 원근의 개념을 활용함으로써 우리가 현실 세계를 볼 때 보는 것을 모방하여 2D 그림을 3D처럼 보이게 합니다. 가까운 오브젝트는 멀리 떨어져 있는 오브.. 2022. 3. 7.
[GLSL] Rotate and Scale https://thebookofshaders.com/08/ The Book of Shaders Gentle step-by-step guide through the abstract and complex universe of Fragment Shaders. thebookofshaders.com https://en.wikipedia.org/wiki/Rotation_matrix Rotation matrix - Wikipedia en.wikipedia.org mat2 rotate2d(float _angle){ return mat2(cos(_angle),-sin(_angle), sin(_angle),cos(_angle)); } #ifdef GL_ES precision mediump float; #endif unif.. 2022. 1. 6.
[Maya] 파이썬으로 모델링하기 (크기, 회전, 색) Modeling with Python (Scale, Rotate, Color) 2019. 3. 11. 21:56 import pymel.core as pm myCubes = [] for n in range (1000): myCubes.append(pm.polyCube()) count = 0 for x in range (10): for y in range (10): for z in range (10): pm.select(myCubes[count]) pm.move(x, y, z) pm.scale(x/10.0, y/10.0, z/10.0) pm.rotate(x*10.0, y*10.0, z*10.0) pm.polyColorPerVertex(colorRGB=[1-x/10.0, 1-y/10.0, 1-z/10.0], colorDisplayOption=True) count = count +1 이.. 2020. 11. 7.
[그래픽스] 기초 수학 (2) - Transformation Matrices (변환 행렬) * Computer Graphics Programming in OpenGL with C++ 책을 참고하였습니다. * 책을 번역한 것이 아닌, 제가 독학 후 책을 참고하여 설명하는 게시물입니다. 따라서 책에 없는 부연 설명이 있기도 하며, 의역 또는 오역, 오개념이 있을 수 있습니다. 피드백은 댓글을 남겨주세요. * 영어 용어를 최대한 한국어로 번역하지 않습니다. 처음부터 코드에서 사용되는, 또는 원서나 인터넷에서 사용되는 보편적 용어를 사용하여 개념을 잡는 것을 추천드립니다. ​ ​ 지난 포스트에 이어, 3D 그래픽스 프로그램에서 수학을 사용하는 방식에 대해 설명하겠습니다. ​ ​ 그래픽스에서는, 물체의 변환을 수행하기 위해 행렬들이 사용됩니다. Translation(이동), Rotation(회전), S.. 2020. 10. 15.