본문 바로가기

전체 글175

[프로그래밍언어론] 과제 2 : OOP 특성을 가진 언어로 구현하기 (Go 사용) 문제 Write a corresponding program for the given example below (in C++, Java and Python) using ONE of the other languages that have different OOP traits such as separation of types from their implementations (e.g. Go), multimethods (e.g. Julia), implementation-only inheritance thru mixin (e.g. Scala, Crystal), prototypes and delegation (e.g. Lua, Io), etc. You will be given better score if you can.. 2020. 12. 20.
[프로그래밍언어론] 과제 1 : 이터레이터 생성자 (Iterator Generator) 만들기 문제 Develop a program per each of the examples of the Python iterator generator for “sort”(quicksort) and “flatten” in ANY language of choice with the following constraints: You MUST NOT use any constructs that are similar or equivalent to the iterator generator of Python (such as “yield”). You have only to use ordinary control structures (if, while, ...) and/or procedure calls. You CAN utilize o.. 2020. 12. 20.
[C 프로그래밍 실습] 함수 1 (Lab 05) Program 1 : mypow( ) 함수 구현 Program 2 : 화씨-섭씨 변환 함수 구현 Program 3 : 최댓값 반환 함수 구현, 삼항연산자 Program 4 : 원 둘레와 넓이 반환 함수 구현 Program 5 : 단리와 복리 계산 함수 구현 Program 1 임의의 실수와 정수, m 과 n을 입력 받아 다음과 같은 mypow() 함수를 작성하여 mn의 결과를 출력하는 프로그램을 작성하시오. (한번만 호출하여 수행하면 됨) 함수 mypow(double m, int n)의 결과는 m^n #include 에 정의된 pow() 함수 와 mypow() 함수 결과를 모두 출력 #include #include double mypow(double m, int n) { if (n == 1) return .. 2020. 11. 21.
[Tensorflow] 이미지/CNN/회귀 - 무작위로 렌더링한 구의 속성 학습하기 visualization lab에서의 첫번째 deep learning (딥러닝) 프로젝트를 소개합니다. 우선 이 프로젝트가 어떤 프로젝트인지부터 간략하게 설명하겠습니다. 1. openGL을 활용하여 구(sphere)를 20,000개 렌더링한다. 2. 렌더링에서 무작위로 설정하는 속성 parameter 5개는 순서대로 R(red), G(green), B(blue), metallic(금속재질), roughness(표면의 거친 정도)를 나타내며, 이를 label로 저장한다. 3. 위에서 만든 구 이미지와 label(parameter 값)을 train set으로 저장한다. 4. test set에 해당하는 1,000개의 구와 1,000쌍(5개씩)의 label을 렌더링-저장한다. 5. 20,000개의 구를 tens.. 2020. 11. 18.
[Maya] 파이썬으로 모델링하기 (애니메이션 : 키프레임 설정, 숨 쉬는 트리) Modeling with Python (Animation : Setting Keyframe and Giving Breath) 2019. 3. 13. 10:39 일단 pymel 코드를 cmds로 변환시켰다. (애니메이션을 설정하기 편리하기 때문이었던 것 같다.) First, I converted pymel code to cmds. import maya.cmds as cmds import random myPyramids = [] #make pyramids for n in range (2872): myPyramids.append(cmds.polyPyramid()) count = 0 for x in range (20): yran = 20 - x for y in range (yran): zran = 20 - y for z in range (zran): cmds.select(myPyramids[count]) cmds.move(0.05*x.. 2020. 11. 7.
[Maya] 파이썬으로 모델링하기 (미러링된 트리) Modeling with Python (Mirrored Tree) 2019. 3. 13. 10:39 드디어, 어떻게 미러링하는지를 알게 되었다. I finally got how to mirror. 잎의 수를 늘리고, 더 큰 별을 달아주었다. more and tinier leaves, a big star import pymel.core as pm import random myPyramids = [] #make pyramids for n in range (2872): myPyramids.append(pm.polyPyramid()) count = 0 for x in range (20): yran = 20 - x for y in range (yran): zran = 20 - y for z in range (zran): pm.select(myPyramids[count]) pm... 2020. 11. 7.
[Maya] 파이썬으로 모델링하기 (크리스마스 트리 1/4) Modeling with Python (Quarter of a Christmas Tree) 2019. 3. 11. 22:08 지금까지 배운 것을 복습하기 위해 크리스마스 트리를 만들어보기로 했다. 빨강-초록 계열의 랜덤한 값을 가진 색상의 잎과, 맨 위에 노란 별을 가진 트리를 만들어보았다. I decided to make a Christmas tree which has green-red randomized-colored leaves and a yellow star on it. import pymel.core as pm import random myPyramids = [] #make pyramids for n in range (386): myPyramids.append(pm.polyPyramid()) count = 0 for x in range (10): yran = 10 - x for y i.. 2020. 11. 7.
[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.
[Maya] 파이썬으로 모델링하기 (랜덤하게 위치하는 구) Modeling with Python (Random-moved Spheres) 2019. 3. 11. 21:49 import maya.cmds as cmds import random myspheres=[] for i in range(100): myspheres.append(cmds.polySphere()) for j in myspheres: cmds.move(random.randint(1,10), random.randint(1,10), random.randint(1,10), j) maya.cmds를 활용한 첫번째 모델이다. my first model made with maya.cmds 2020. 11. 7.