블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
  • total
  • today
  • yesterday

Category


interpolation
http://en.wikipedia.org/wiki/Interpolation

http://mathworld.wolfram.com/Interpolation.html
The computation of points or values between ones that are known or tabulated using the surrounding points or values.


ref.
http://www.cplusplus.com/reference/clibrary/cmath/


'@GSMC > 서용덕: DMD Programming' 카테고리의 다른 글

[Steve Oualline] 13. Simple Pointers  (0) 2008.06.10
Similarity Transformation  (0) 2008.06.10
[Steve Oualline] 12. Advanced Types  (0) 2008.05.28
data type 정리  (0) 2008.05.24
[Steve Oualline] 11. Bit Operations  (0) 2008.05.14
posted by maetel

2008-05-30 쇠 낮 @가브리엘관 504호

사용자 삽입 이미지
사용자 삽입 이미지




2008-05-30 쇠

mapping: multilister / hypershade

(1)
window> rendering editor> multilister
-> edit> create>
: create render node>

material:
anisotropic - velvet
lambert - cloth 옷감 (반사광이 없음)
layered shades - (이 자체로는 매핑하지 못함)
ocean shades - 물
phong
shading map - 그림자

textures:
fractal/mountain/noise/ramp
: 그대로 쓰기보다는 재질 표현을 위해 사용

ocean: 기포 표현 가능


(2)
window> rendering editor> hypershade

panels> saved layout> hypershade/outliner/persp 선택


perspective 창:
view> camera settings> resolution gate


hypershade/renderview/persp 모드에서

IPR 렌더

'@GSMC > 정재환: 3D Modeling&Rendering' 카테고리의 다른 글

class 13 - mapping: bump + specular  (0) 2008.06.20
class 12  (0) 2008.06.13
class 9 공룡 만들기  (0) 2008.05.23
class 7 - 돌고래 완성  (0) 2008.05.02
class 6 - dolphin  (0) 2008.04.25
posted by maetel
2008. 5. 29. 08:14 @GSMC/정문열: Generative Art
Visualizing Data
Ben Fry

ref.    GoogleBook

Chapter 7: Trees, Hierarchies, and Recursion

treemap: Ben Shneiderman   http://www.cs.umd.edu/hcil/treemap-history/
map of the market: Martin Wattenberg   http://www.smartmoney.com/map-of-the-market/
newsmap: Marcos Weskkamp    http://www.marumushi.com/apps/newsmap/

an open source library for creating treemap structures (HCIL)
http://www.cs.umd.edu/hcil/treemap-history/Treemaps-Java-Algorithms.zip

a modified version as a Processing library
http://benfry.com/writing/treemap/library.zip
http://benfry.com/writing/treemap/equator.txt



'@GSMC > 정문열: Generative Art' 카테고리의 다른 글

Evolutionary and Swarm Design  (0) 2008.06.27
genetic programming  (0) 2008.06.05
변수  (0) 2008.05.17
class 5/1  (0) 2008.05.01
Class와 Object  (0) 2008.04.14
posted by maetel
Steve Oualline

12. Advanced Types


Structures
http://www.cplusplus.com/doc/tutorial/structures.html

anonymous structure


Unions

176쪽 remote tape이 뭐야?


typedef


enum type
Enumerations

http://www.cplusplus.com/doc/tutorial/other_data_types.html


Casting

http://www.cplusplus.com/doc/tutorial/typecasting.html


Bit Fields or Packed Structures


'@GSMC > 서용덕: DMD Programming' 카테고리의 다른 글

Similarity Transformation  (0) 2008.06.10
hw 9 - ppm 이미지 회전시키기  (0) 2008.05.30
data type 정리  (0) 2008.05.24
[Steve Oualline] 11. Bit Operations  (0) 2008.05.14
append()  (0) 2008.05.01
posted by maetel
Variables. Data Types.
http://www.cplusplus.com/doc/tutorial/variables.html



unsigned

Finally, signed and unsigned may also be used as standalone type specifiers, meaning the same as signed int and unsigned int respectively.

'@GSMC > 서용덕: DMD Programming' 카테고리의 다른 글

hw 9 - ppm 이미지 회전시키기  (0) 2008.05.30
[Steve Oualline] 12. Advanced Types  (0) 2008.05.28
[Steve Oualline] 11. Bit Operations  (0) 2008.05.14
append()  (0) 2008.05.01
[Steve Oualline] 10. C Preprocessor  (0) 2008.04.22
posted by maetel

2008-05-23 쇠 낮 @가브리엘관 504

사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지



공룡 만들기


1) 셋팅

1. project 폴더를 생성한다.
File > Project > New

2. sourceimages 폴더에 이미지 파일을 저장한다.

3. 각 창에서 이미지 불러오기
View > image plane > 위의 파일을 불러 온다.

4. imagePlane을 선택하고
INPUTS>imagePlane 활성화> CenterY : -1

5. 각 창 메뉴 View > Image Plane>
Image Plane Attributes > Alpha Gain: 낮춤

6.
perspective 창에서 모든 image planes 선택 ->
Display > Hide > Hide Selection
(persp 창에서만 오브젝트가 사라진다.)


2) 모델링

1. 큐브를 하나 꺼낸다.
subdivision > w:2, h:2, d:10

2. side 창에서 vertex 모드로 위치 조정
(입을 기준으로 맞추기 시작, 사지가 나올 면을 확보.)

3. 전체 vertex 선택 후, 가운데 점들만 빼고
모퉁이 vertex들을 크기 조정하여 전체적으로 둥글게 한다.

4. front 창에서 vertex 크기 조정 ->
top 창에서 vertex 크기/위치 조정

5.
(keep faces together) 윗입술 면 두 개 선택 ->
extrude face 6회 정도 ->
side 창에서 vertex 조절
(tip: 위 두 개 점들은 한 면을 형성하므로 함께 움직일 것)

6. 입술, 잇몸, 이빨 만들기

7. 팔 만들기
어깨 부분



과제 #2
네 발이 땅에 닿아 있는 공룡
cgland.co.kr
http://highend3d.com/


'@GSMC > 정재환: 3D Modeling&Rendering' 카테고리의 다른 글

class 12  (0) 2008.06.13
class 10 - mapping  (0) 2008.05.30
class 7 - 돌고래 완성  (0) 2008.05.02
class 6 - dolphin  (0) 2008.04.25
class 5 - 키보드 만들기  (0) 2008.04.18
posted by maetel
2008. 5. 17. 16:33 @GSMC/정문열: Generative Art
Head First Java 개정판


84쪽
변수는 원시 변수(primitive variable)와 객체 레퍼런스(objectreference)로 나눌 수 있다.

여덟 가지 원시 유형 -
boolean, char, byte, short, int, long, float, double

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html


88쪽
원시 변수는 변수의 실제 값을 나타내는 비트가 들어있지만,
객체 레퍼런스에는 객체에 접근하는 방법을 알려주는 비트가 들어있다. (비트 수는 중요하지 않다.)
(객체 자체는 변수에 저장되지 않는다.)
(96쪽) 레퍼런스 변수의 값은 힙에 들어있는 객체를 건드릴 수 있는 방법을 나타내는 비트.
레퍼런스 변수가 아무 객체도 참조하지 않으면 그 값은 null이 됩니다.

89쪽
객체 선언/생성/대입의 3단계
1. 레퍼런스 변수 선언 (객체를 제어하기 위한 레퍼런스 변수용 공간을 할당)
2. 객체 생성 (힙에 새로운 객체를 위한 공간을 마련)
3. 객체와 레퍼런스 연결 (새로운 객체를 레퍼런스 변수에 대입)

92쪽
garbage collection
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html

http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)


93쪽
배열은 원시 변수의 배열이든 객체 레퍼런스에 대한 배열이든 상관없이 항상 객체입니다.

1. 배열 변수를 선언한다.
2. 일정 길이의 배열을 만들어서 앞서 선언한 변수에 대입한다.
3. 새로운 객체를 생성하고 그 객체를 배열 원소에 대입한다.



'@GSMC > 정문열: Generative Art' 카테고리의 다른 글

genetic programming  (0) 2008.06.05
treemaps  (0) 2008.05.29
class 5/1  (0) 2008.05.01
Class와 Object  (0) 2008.04.14
[이선애] study 1  (0) 2008.03.28
posted by maetel
Steve Oualline

11. Bit Operations


A bit is the smallest unit of information. Normally, it is represented by the values 1 and 0. Bit manipulations are used to control the machine at the lowest level.    (156p)

compound operators (&=, |=)
http://www.cplusplus.com/doc/tutorial/operators.html

ref.
http://en.wikipedia.org/wiki/Parity_bit

http://en.wikipedia.org/wiki/Discrete_mathematics



166p
Example 11-2
#include <stdio.h>

const unsigned int HIGH_SPEED = (1<<7);

const unsigned int DIRECT_CONNECT = (1<<8);

unsigned char flags = 0;

int main()
{
    flags |= HIGH_SPEED;
    flags |= DIRECT_CONNECT;
   
    if ((flags & HIGH_SPEED) != 0)
        printf("High speed set: flags = %d %x\n", flags, flags);
   
    if ((flags & DIRECT_CONNECT) != 0)
        printf("Direct connect set: flags = %d %x\n", flags, flags);
    return(0);
}

실행 결과:
High speed set: flags = 128 80


char인 flags와 int인 DIRECT_CONNECT를 비교하면 8bits와 32bits를 비교하는 셈이다. 이때 8bits를 늘려 32bits에 맞추어 고려하게 된다. (XCode에서 컴파일하면, 추가된 자리에 통상 (signed일 때) 1을 집어 넣고 unsigned의 경우 0을 집어 넣는다. 그래서 flags를 그냥(signed) char로 선언한 경우 다음과 같이 되어 flags & DIRECT_CONNECT 가 0이 아니게 되었던 것이다.)

High speed set: flags = -128 ffffff80
Direct connect set: flags = -128 ffffff80

한편, flags를 int로 선언하고 실행하면 결과가 다음과 같다. (signed일 때와 unsigned일 때 모두 동일한 결과)

High speed set: flags = 384 180
Direct connect set: flags = 384 180



In bitmapped graphics, each pixel on the screen is represented by a single bit in memory.     (167p)



'@GSMC > 서용덕: DMD Programming' 카테고리의 다른 글

[Steve Oualline] 12. Advanced Types  (0) 2008.05.28
data type 정리  (0) 2008.05.24
append()  (0) 2008.05.01
[Steve Oualline] 10. C Preprocessor  (0) 2008.04.22
hw 6 - 9장 연습문제 3번  (0) 2008.04.17
posted by maetel

돌고래 완성
(다음 주 시험 40분- 눈 제외)



tip.
vertex들 일직선상에 맞추기:
move 툴 double click
> retain component spacing 해제


tip.
돌고래 반쪽 mirro copy > combine
> edit polygons > merge vertex 옵션
: distance = 0.0001


duplicate

hierarchy (group, parent/child)

opject / component mode



'@GSMC > 정재환: 3D Modeling&Rendering' 카테고리의 다른 글

class 10 - mapping  (0) 2008.05.30
class 9 공룡 만들기  (0) 2008.05.23
class 6 - dolphin  (0) 2008.04.25
class 5 - 키보드 만들기  (0) 2008.04.18
class 4 - 플로피 디스크  (0) 2008.04.11
posted by maetel

by 서 교수님


int *arr;
arr = new int[N];   //C++
arr = (int *) malloc(sizeof(int)*N);    //C

"realloc"


int *A;
int len = 3;

int *append (int *A, int lA, int lB)
{
    int *B = new int[5];
    for (i=0; i<3; i++)
    {
       B[i] = A[i];
       delete [] A;
    }
    return B;
}

A = append (A, 3, 5);






posted by maetel
2008-05-01 나무 @504


1) random Tree 생성

함수 리스트
terminal (단말) 리스트

함수 리스트에서 {+, *, cos, ..., minus} random하게 선택하여 (uniform distribution) Tree의 root로 삼는다.
depth 만큼 Tree를 생성하고 나면, 단말 리스트에서 random하게 선택하여 Tree의 leaf로 삼는다


주어진 depth에 대해
(1) 상수일지 함수일지 선택
(2) 상수이면 leaf가 되는 것이고, 함수이면 다음 depth를 생성한다.

if (current.depth < maximum.depth)
{ 함수 선택 }


1. Class Tree를 만들고
2. Tree instance를 여러 개 만들어서 list로 만든다.
3. 주어진 depth에 대해 2로부터 random choice로 Tree 구조를 생성한다.
"Left를 먼저 채울지 Right를 먼저 채울지도 random으로 선택"


2) mutation과 combination

방법
1. mutation이 일어날 Tree를 random하게 (낮은 비율로) 선택한다.
2. 각 node를 방문하여 mutation의 여부를 결정한다.
3.




'@GSMC > 정문열: Generative Art' 카테고리의 다른 글

treemaps  (0) 2008.05.29
변수  (0) 2008.05.17
Class와 Object  (0) 2008.04.14
[이선애] study 1  (0) 2008.03.28
class 3/27  (0) 2008.03.27
posted by maetel


포유류의 모델링은 입 주위부터 시작한다.

1. 큐브 꺼내서 subdivision 설정
width 10
height 2
depth 2

2.
front view (돌고래 측면)에서 vertex 조정
: 후에 지느러미를 뽑아낼 수 있도록 면을 배정

3. top view에서 vertex 조정
: control키 사용


front view에서 전체 선택 후 가운데 줄 vertex만 해제
side view에서 vertex 조정 scale (y 방향 축소 후, z방향 축소)
front view에서 가운데 줄 vertex들만 선택 후 scale 확대
 

4. face 모드에서 입 쪽 가장자리 윗면 두 개 선택
> extrude face (6번 정도)
> 2,3과 같이 vertex 조정
: 마지막에 세 점이 모여야 함
 
5.
입 안쪽에 해당하는 면 선택 (keep face together)
> extrude > scale 축소 (입술 두께)
> extrude > move (입술 -> 입천장)
> extrude > scale 축소 (잇몸 두께)
> extrude > move (잇몸 높이 만큼 다시 빼주기)

6. 이빨 만들기
edit polygon> split polygon tool
> (keep face together 해제 상태에서) 잇몸 선택
> extrude > scale 축소 (이빨 뿌리 부분)
> extrude > move (이빨 빼주기)> scale (이빨 끝 부분)


보너스 "사과 만들기"
NURBS
1. curve tool 사용해서 사과 반쪽을 그린다.
2. 아래쪽 끝점 선택 ->
surfaces> revolve 클릭
3. front view에서 vertex 조정


'@GSMC > 정재환: 3D Modeling&Rendering' 카테고리의 다른 글

class 9 공룡 만들기  (0) 2008.05.23
class 7 - 돌고래 완성  (0) 2008.05.02
class 5 - 키보드 만들기  (0) 2008.04.18
class 4 - 플로피 디스크  (0) 2008.04.11
class 3 - 의자 만들기  (0) 2008.04.04
posted by maetel

preprocessor
http://www.cplusplus.com/doc/tutorial/preprocessor.html



http://en.wikipedia.org/wiki/C_preprocessor
The preprocessor handles directives for source file inclusion (#include), macro definitions (#define), and conditional inclusion (#if).

http://en.wikipedia.org/wiki/Preprocessor


constants
macros
include files


#define statement

A preprocessor directive terminates at the end-of-line.
A line may be continued by putting a backslash (\) at the end.
(142쪽)

It is common programming practice to use all uppercase letters for macro names. (142쪽)

http://en.wikipedia.org/wiki/Bourne_shell

http://en.wikipedia.org/wiki/ALGOL_68


144쪽
예제 4: first.c
터미널에서 "cc -E main.cpp"라고 치니... @_@
999:~/cintro/ch10/eg4 lym$ cc -E main.cpp
# 1 "main.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "main.cpp"
# 1 "/usr/include/stdio.h" 1 3 4
# 64 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/_types.h" 1 3 4
# 27 "/usr/include/_types.h" 3 4
# 1 "/usr/include/sys/_types.h" 1 3 4
# 26 "/usr/include/sys/_types.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 27 "/usr/include/sys/_types.h" 2 3 4
# 1 "/usr/include/machine/_types.h" 1 3 4
# 26 "/usr/include/machine/_types.h" 3 4
# 1 "/usr/include/ppc/_types.h" 1 3 4
# 31 "/usr/include/ppc/_types.h" 3 4
typedef signed char __int8_t;



typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;

typedef long __darwin_intptr_t;
typedef unsigned int __darwin_natural_t;
# 64 "/usr/include/ppc/_types.h" 3 4
typedef int __darwin_ct_rune_t;





typedef union {
 char __mbstate8[128];
 long long _mbstateL;
} __mbstate_t;

typedef __mbstate_t __darwin_mbstate_t;


typedef int __darwin_ptrdiff_t;





typedef long unsigned int __darwin_size_t;





typedef __builtin_va_list __darwin_va_list;





typedef int __darwin_wchar_t;




typedef __darwin_wchar_t __darwin_rune_t;


typedef int __darwin_wint_t;




typedef unsigned long __darwin_clock_t;
typedef __uint32_t __darwin_socklen_t;
typedef long __darwin_ssize_t;
typedef long __darwin_time_t;
# 27 "/usr/include/machine/_types.h" 2 3 4
# 28 "/usr/include/sys/_types.h" 2 3 4



struct mcontext;
struct mcontext64;
# 60 "/usr/include/sys/_types.h" 3 4
struct __darwin_pthread_handler_rec
{
 void (*__routine)(void *);
 void *__arg;
 struct __darwin_pthread_handler_rec *__next;
};
struct _opaque_pthread_attr_t { long __sig; char __opaque[36]; };
struct _opaque_pthread_cond_t { long __sig; char __opaque[24]; };
struct _opaque_pthread_condattr_t { long __sig; char __opaque[4]; };
struct _opaque_pthread_mutex_t { long __sig; char __opaque[40]; };
struct _opaque_pthread_mutexattr_t { long __sig; char __opaque[8]; };
struct _opaque_pthread_once_t { long __sig; char __opaque[4]; };
struct _opaque_pthread_rwlock_t { long __sig; char __opaque[124]; };
struct _opaque_pthread_rwlockattr_t { long __sig; char __opaque[12]; };
struct _opaque_pthread_t { long __sig; struct __darwin_pthread_handler_rec *__cleanup_stack; char __opaque[596]; };
# 96 "/usr/include/sys/_types.h" 3 4
typedef __int64_t __darwin_blkcnt_t;
typedef __int32_t __darwin_blksize_t;
typedef __int32_t __darwin_dev_t;
typedef unsigned int __darwin_fsblkcnt_t;
typedef unsigned int __darwin_fsfilcnt_t;
typedef __uint32_t __darwin_gid_t;
typedef __uint32_t __darwin_id_t;
typedef __uint32_t __darwin_ino_t;
typedef __darwin_natural_t __darwin_mach_port_name_t;
typedef __darwin_mach_port_name_t __darwin_mach_port_t;

typedef struct mcontext *__darwin_mcontext_t;
typedef struct mcontext64 *__darwin_mcontext64_t;



typedef __uint16_t __darwin_mode_t;
typedef __int64_t __darwin_off_t;
typedef __int32_t __darwin_pid_t;
typedef struct _opaque_pthread_attr_t
   __darwin_pthread_attr_t;
typedef struct _opaque_pthread_cond_t
   __darwin_pthread_cond_t;
typedef struct _opaque_pthread_condattr_t
   __darwin_pthread_condattr_t;
typedef unsigned long __darwin_pthread_key_t;
typedef struct _opaque_pthread_mutex_t
   __darwin_pthread_mutex_t;
typedef struct _opaque_pthread_mutexattr_t
   __darwin_pthread_mutexattr_t;
typedef struct _opaque_pthread_once_t
   __darwin_pthread_once_t;
typedef struct _opaque_pthread_rwlock_t
   __darwin_pthread_rwlock_t;
typedef struct _opaque_pthread_rwlockattr_t
   __darwin_pthread_rwlockattr_t;
typedef struct _opaque_pthread_t
   *__darwin_pthread_t;
typedef __uint32_t __darwin_sigset_t;
typedef __int32_t __darwin_suseconds_t;
typedef __uint32_t __darwin_uid_t;
typedef __uint32_t __darwin_useconds_t;
typedef unsigned char __darwin_uuid_t[16];



struct sigaltstack



{
 void *ss_sp;
 __darwin_size_t ss_size;
 int ss_flags;
};

typedef struct sigaltstack __darwin_stack_t;






struct ucontext



{
 int uc_onstack;
 __darwin_sigset_t uc_sigmask;
 __darwin_stack_t uc_stack;

 struct ucontext *uc_link;



 __darwin_size_t uc_mcsize;
 __darwin_mcontext_t uc_mcontext;
};

typedef struct ucontext __darwin_ucontext_t;





struct ucontext64 {
 int uc_onstack;
 __darwin_sigset_t uc_sigmask;
 __darwin_stack_t uc_stack;
 struct ucontext64 *uc_link;
 __darwin_size_t uc_mcsize;
 __darwin_mcontext64_t uc_mcontext64;
};
typedef struct ucontext64 __darwin_ucontext64_t;
# 28 "/usr/include/_types.h" 2 3 4

typedef int __darwin_nl_item;
typedef int __darwin_wctrans_t;



typedef unsigned long __darwin_wctype_t;
# 65 "/usr/include/stdio.h" 2 3 4






typedef __darwin_va_list va_list;




typedef __darwin_size_t size_t;







typedef __darwin_off_t fpos_t;
# 98 "/usr/include/stdio.h" 3 4
struct __sbuf {
 unsigned char *_base;
 int _size;
};


struct __sFILEX;
# 132 "/usr/include/stdio.h" 3 4
typedef struct __sFILE {
 unsigned char *_p;
 int _r;
 int _w;
 short _flags;
 short _file;
 struct __sbuf _bf;
 int _lbfsize;


 void *_cookie;
 int (*_close)(void *);
 int (*_read) (void *, char *, int);
 fpos_t (*_seek) (void *, fpos_t, int);
 int (*_write)(void *, const char *, int);


 struct __sbuf _ub;
 struct __sFILEX *_extra;
 int _ur;


 unsigned char _ubuf[3];
 unsigned char _nbuf[1];


 struct __sbuf _lb;


 int _blksize;
 fpos_t _offset;
} FILE;

extern "C" {





extern FILE __sF[];

}
# 248 "/usr/include/stdio.h" 3 4
extern "C" {
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE * , fpos_t *);
char *fgets(char * , int, FILE *);
FILE *fopen(const char * , const char * );
int fprintf(FILE * , const char * , ...) __asm("_" "fprintf" "$LDBLStub");
int fputc(int, FILE *);
int fputs(const char * , FILE * );
size_t fread(void * , size_t, size_t, FILE * );
FILE *freopen(const char * , const char * ,
     FILE * ) ;
int fscanf(FILE * , const char * , ...) __asm("_" "fscanf" "$LDBLStub");
int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
size_t fwrite(const void * , size_t, size_t, FILE * ) ;
int getc(FILE *);
int getchar(void);
char *gets(char *);

extern const int sys_nerr;
extern const char *const sys_errlist[];

void perror(const char *);
int printf(const char * , ...) __asm("_" "printf" "$LDBLStub");
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
int rename (const char *, const char *);
void rewind(FILE *);
int scanf(const char * , ...) __asm("_" "scanf" "$LDBLStub");
void setbuf(FILE * , char * );
int setvbuf(FILE * , char * , int, size_t);
int sprintf(char * , const char * , ...) __asm("_" "sprintf" "$LDBLStub");
int sscanf(const char * , const char * , ...) __asm("_" "sscanf" "$LDBLStub");
FILE *tmpfile(void);
char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE * , const char * , va_list) __asm("_" "vfprintf" "$LDBLStub");
int vprintf(const char * , va_list) __asm("_" "vprintf" "$LDBLStub");
int vsprintf(char * , const char * , va_list) __asm("_" "vsprintf" "$LDBLStub");

int asprintf(char **, const char *, ...) __asm("_" "asprintf" "$LDBLStub");
int vasprintf(char **, const char *, va_list) __asm("_" "vasprintf" "$LDBLStub");

}
# 308 "/usr/include/stdio.h" 3 4
extern "C" {
char *ctermid(char *);

char *ctermid_r(char *);

FILE *fdopen(int, const char *);

char *fgetln(FILE *, size_t *);

int fileno(FILE *);
void flockfile(FILE *);

const char
 *fmtcheck(const char *, const char *);
int fpurge(FILE *);

int fseeko(FILE *, fpos_t, int);
fpos_t ftello(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
int getc_unlocked(FILE *);
int getchar_unlocked(void);

int getw(FILE *);

int pclose(FILE *);
FILE *popen(const char *, const char *);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);

int putw(int, FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);

int snprintf(char * , size_t, const char * , ...) __asm("_" "snprintf" "$LDBLStub");
char *tempnam(const char *, const char *);
int vfscanf(FILE * , const char * , va_list) __asm("_" "vfscanf" "$LDBLStub");
int vscanf(const char * , va_list) __asm("_" "vscanf" "$LDBLStub");
int vsnprintf(char * , size_t, const char * , va_list) __asm("_" "vsnprintf" "$LDBLStub");
int vsscanf(const char * , const char * , va_list) __asm("_" "vsscanf" "$LDBLStub");

FILE *zopen(const char *, const char *, int);

}





extern "C" {
FILE *funopen(const void *,
  int (*)(void *, char *, int),
  int (*)(void *, const char *, int),
  fpos_t (*)(void *, fpos_t, int),
  int (*)(void *));
}
# 372 "/usr/include/stdio.h" 3 4
extern "C" {
int __srget(FILE *);
int __svfscanf(FILE *, const char *, va_list) __asm("_" "__svfscanf" "$LDBLStub");
int __swbuf(int, FILE *);
}







static inline int __sputc(int _c, FILE *_p) {
 if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
  return (*_p->_p++ = _c);
 else
  return (__swbuf(_c, _p));
}
# 2 "main.cpp" 2





int main() {
 printf("The square of all the parts is %d\n",
     7 + 5 * 7 + 5);
 return(0);
}


예제5: max.c
int main()
{
 int counter;

 for (counter = =10; counter > 0; --counter)
  printf("Hi there\n");

 return(0);
}


예제6: size.c
int main()
{
 int size;

 size = 10; -2;;
 printf("Size is %d\n", size);
 return(0);
}


예제7: die.c
int main()
{

 int value;

 value = 1;
 if (value < 0)
  fprintf((&__sF[2]), "Fatal Error:Abort\n");exit(8);;

 printf("We did not die\n");
 return (0);
}



#define vs. const

const
http://www.cprogramming.com/tutorial/const_correctness.html
The const keyword allows you to specify whether or not a variable is modifiable. You can use const to prevent modifications to variables and const pointers and const references prevent changing the data pointed to (or referenced).


Conditional Compilation

http://cplusplus.com/doc/tutorial/preprocessor.html

#ifdef
allows a section of a program to be compiled only if the macro that is specified as the parameter has been defined, no matter which its value is.

#endif
the whole structure of #if, #elif and #else chained directives ends with #endif.

#undef

#ifndef
#ifndef symbol is true if the symbol is not defined.


#else

http://en.wikibooks.org/wiki/C_Programming/Preprocessor


include Files

Files that are included in other programs are called header files.
The angle brackets (<>) indicate that the file is a standard header file. (On UNIX, these files are located in /usr/include.)

Standard include files define data structures and macros used by library routines. (eg. printf is a library routine that prints data on the standard output. The FILE structure used by printf and its related routines is defined in stdio.h.)

cstdio (stdio.h)
C library to perform Input/Output operations
http://cplusplus.com/reference/clibrary/cstdio/
This library uses what are called streams to operate with physical devices such as keyboards, printers, terminals or with any other type of files supported by the system. Streams are an abstraction to interact with these in an uniform way; All streams have similar properties independently of the individual characteristics of the physical media they are associated with.

Streams are handled in the cstdio library as pointers to FILE objects. A pointer to a FILE object uniquely identifies a stream, and is used as a parameter in the operations involving that stream.

There also exist three standard streams: stdin, stdout and stderr, which are automatically created and opened for all programs using the library.


Local include files are particulary useful for storing constants and data structures when a program spans several files. (149쪽) Local include files may be specified by using double quotes (" ") around the file name. The specification can be a simple file, a relative path, or an absolute path.


그니까 148쪽 symbol은 뭐고 149쪽 union이 뭐냐고???






posted by maetel

키보드 만들기

cube
vertex 모드에서 위의 네 점 선택
스케일 줄이고 높이를 낮춤

edit polygons > bevels
: offset = 0.1

duplicate:
transform: x=1.0
copy 14

(전체 선택 상태에서) edit> group

duplicate:

*참고 - 엔터키 만들기
edit polygons> split polygon tool

'@GSMC > 정재환: 3D Modeling&Rendering' 카테고리의 다른 글

class 7 - 돌고래 완성  (0) 2008.05.02
class 6 - dolphin  (0) 2008.04.25
class 4 - 플로피 디스크  (0) 2008.04.11
class 3 - 의자 만들기  (0) 2008.04.04
class 2 - 컴퓨터 모니터 만들기  (0) 2008.03.28
posted by maetel

아우~ 진짜 어려워서 죽는 줄 알았네.
난 recursive function 아직 소화를 못 했다.
보고 이해하는 건 되는데 직접 만드는 건 무지 어렵다.
적어도 수십 개 만들어 봐야 이해할 수 있을 것 같다.
이 정도로 어렵게 느껴지는 건 C를 배운 이후 처음인 것 같다.

그동안 함수를 만들어 보지 않았던 것도 약점이 되었다.
함수를 만들려다 보니 변수명 앞에 * 붙이는 것에 대해 좀더 분명한 이해가 필요하다는 것을 깨달았다.

공부해야 할 것:
1) 함수 만들기 (만드는 버릇 들이기)
2) * (변수명) 의 활용에 대한 이해
3) recursive function 만들기 - 다양한 예제 풀어 보기



ref.
http://www.cprogramming.com/tutorial/c/lesson16.html

http://en.wikipedia.org/wiki/Recursion_%28computer_science%29

static variables
http://en.wikipedia.org/wiki/Static_variable#Static_Variables_as_Class_Variables


http://annwm.lbl.gov/~leggett/vars.html (informed by noah)


'@GSMC > 서용덕: DMD Programming' 카테고리의 다른 글

append()  (0) 2008.05.01
[Steve Oualline] 10. C Preprocessor  (0) 2008.04.22
[Steve Oualline] 9. Variable Scope and Functions  (0) 2008.04.16
to calculate the exponent of a power number  (0) 2008.04.16
week 6 review  (0) 2008.04.16
posted by maetel
Steve Oualline


Scope and Class

The scope of a variable is the area of the program in which the variable is valid.

A block is a section of code enclosed in curly braces.

The declaration of a local variable takes precedence over the global declaration inside the small block in which the local variable is declared.   (127쪽)

The class of a variable may be either permanent or temporary.
Global variables are always permanent. They are created and initialized before the program starts and remain until it terminates.    (129쪽)

Temporary variables are allocated from a section of memory called the stack at the beginning of the block. The space used by the temporary variables is returned to the stack at the end of the block. Each time the block is entered, the temporary variables are initialized.   (129쪽)

Temporary variables are sometimes refered to as automatic variables because the space for them is allocated automatically.   (130쪽)


stack
webopedia:
In programming, a special type of data structure in which items are removed in the reverse order from that in which they are added, so the most recently added item is the first one removed. This is also called last-in, first-out (LIFO).
Adding an item to a stack is called pushing. Removing an item from a stack is called popping.

cf.
http://cplusplus.com/reference/stl/stack/
Cprogramming.com: The stack data structure

의문: memory는 CPU 밖에, register는 CPU 안에,  stack은 어디에? memory에?
그럼 stack은 memory인가?
memory에서 stack인 부분과 stack이 아닌 부분을 컴퓨터가 어떻게 구분짓나?
global variables는 프로그램이 끝날 때까지 memory에서 각각 하나의 주소값을 유지하나?

http://en.wikipedia.org/wiki/Stack_%28data_structure%29
a stack is an abstract data type and data structure based on the principle of Last In First Out (LIFO).

A typical stack is an area of computer memory with a fixed origin and a variable size. Initially the size of the stack is zero. A stack pointer, usually in the form of a hardware register, points to the most recently referenced location on the stack; when the stack has a size of zero, the stack pointer points to the origin of the stack.

The two operations applicable to all stacks are:

  • a push operation, in which a data item is placed at the location pointed to by the stack pointer, and the address in the stack pointer is adjusted by the size of the data item;
  • a pop or pull operation: a data item at the current location pointed to by the stack pointer is removed, and the stack pointer is adjusted by the size of the data item.


There are many variations on the basic principle of stack operations. Every stack has a fixed location in memory at which it begins. As data items are added to the stack, the stack pointer is displaced to indicate the current extent of the stack, which expands away from the origin (either up or down, depending on the specific implementation).

A stack is usually represented in computers by a block of memory cells, with the "bottom" at a fixed location, and the stack pointer holding the address of the current "top" cell in the stack. The top and bottom terminology are used irrespective of whether the stack actually grows towards lower memory addresses or towards higher memory addresses.


Many CPUs have registers that can be used as stack pointers.

In application programs written in a high level language, a stack can be implemented efficiently using either arrays or linked lists.


The size of the stack depends on the system and compiler you are using. On many UNIX systems, the program is automatically allocated the largest possible stack.   (129쪽)

cp. register
http://en.wikipedia.org/wiki/Processor_register

의문:
register에도 주소가 있을까?
register는 memory의 주소와 그 주소에 들어가는 데이터를 가지고 있는 것인가? (그렇다면 '&변수명'과 관계가 있는가?)
register가 stack에도 마찬가지로 작용하나?
만약에 그렇다면, stack에서 memory의 주소에 들어가는 데이터가 자꾸 변할 때마다 register 역시 그 정보를 동시에 알고 있다는 뜻인가? 그렇다면, 어떻게 아는 것인가? 그러니까 stack과 register는 같이 움직이나?


cf. static
It indicates that a variable is local to the current file.    (129쪽)


Functions

Functions allow us to group commonly used  code into a compact until that can be used repeatedly.   (130쪽)

Function: Name, Description, Parameters, Returns, (file formats, references, or notes)

C uses a form of parameter passing called "Call by value".   (131쪽)



function prototype

ref.   http://www.cprogramming.com/tutorial/lesson4.html
Just like a blueprint, the prototype tells the compiler what the function will return, what the function will be called, as well as what arguments the function can be passed. When I say that the function returns a value, I mean that the function can be used in the same manner as a variable would be.


void


Structured Programming

Structured programming techniques are ways of dividing up or structuring a program into small, well-defined functions.   (135쪽)

top-down programming
bottom-up programming


Recursion

Recurion occurs when a fuction calls itself directly or indirectly.    (136쪽)

1. It must have an ending point.
2. It must make the problem simpler.




posted by maetel

음냐리~ 공부하려고 한 거 아닌데... 계산기 찾는 것보다 코딩하는 게 더 간편하게 느껴져서. 쿄쿄.

//exponentiation for a number

#include <iostream>

char line[100];    // input data
int number;    // a number converted from input
int exponent = 0;   
int base = 2;

int main (int argc, char * const argv[]) {
    // to get a number from a user
    printf("Enter a number    :    ");
    fgets(line, sizeof(line), stdin);
   
    // to convert input data to number
    number = atoi(line);
   
    // to calculate its exponent on the base
    int i;
    for (i=0; number>1; i++)
    {
        number /= base;
        exponent = i+1;
    }
    printf("base %d to the %d-th power\n", base, exponent);
       
    return 0;
}



실행창:
Enter a number    :    65536
base 2 to the 16-th power


업그레이드 버전:
//exponentiation for a number

#include <iostream>

char line[100];    // input data
int number;    // a number converted from input
int exponent = 0; // exponent number to be calculated   
int base = 2; // base to power

int main (int argc, char * const argv[]) {
    while(1)
    {
        // to get a number from a user
        printf("Enter a number    :    ");
        fgets(line, sizeof(line), stdin);
       
        if (line[0]==10)    // no input but enter
            break;    // exit
        else
        {
        // to convert input data to number
            number = atoi(line);
           
            // to calculate its exponent on the base
            int i;
            int flag = 0; // indicator
            int origin = number; //to reserve the input number
            for (i=0; number>=base; i++)
            {
                int remainder = number % base;
                if (remainder != 0) //not power based on base number
                {   
                    printf("%d does not have %d-based power.\n", origin, base);
                    flag = 1; //error to calculate exponentiation
                    break;
                }
                else
                {   
                    number /= base;               
                    exponent = i+1;
                }
            }
            if (flag==1) //error
                continue;
            else if(flag==0)
                printf("base %d to the %d-th power\n", base, exponent);
        }
    }
        return 0;
}


실행창:
Enter a number    :    65536
base 2 to the 16-th power
Enter a number    :    2
base 2 to the 1-th power
Enter a number    :    3
3 does not have 2-based power.
Enter a number    :    256
base 2 to the 8-th power
Enter a number    :    255
255 does not have 2-based power.
Enter a number    :   

expon has exited with status 0.

아 놔~ 나 숙제 안 하고 뭐하고 있는 거지? 열도 안 떨어지는구만. ㅜㅜ

posted by maetel
PGM image file format

http://netpbm.sourceforge.net/

PGM
= Portable Gray Map
Jef Poskanzer @ ttp://netpbm.sourceforge.net/doc/pgm.html

http://en.wikipedia.org/wiki/Portable_Gray_Map
The portable graymap file format (PGM) provides very basic functionality and serve as a least-common-denominator for converting pixmap, graymap, or bitmap files between different platforms.

Webopedia: Graphics File Formats Reference
Portable Greymap (.pgm)
Files are created by Jef Poskanzer's PBMPlus Portable Bitmap Utilities. The portable graymap format is a lowest common denominator grayscale file format.




libnetpbm, C subroutine library
Libnetpbm Directory (the reference information for a particular function)


delimiter
webopedia: A punctuation character or group of characters that separates two names or two pieces of data, or marks the beginning or end of a programming construct. Delimiters are used in almost every computer application. For example, in specifying DOS pathnames, the backslash (\) is the delimiter that separates directories and filenames. Other common delimiters include the comma (,), semicolon (;), quotes ("), and braces ({}).
empas: 구분 문자: 임의의 기호로 이루어지는 열을 구성 요소로 구분 짓기 위한 문자. 일반적으로 구성 요소는 영문자나 정수와 같이 뜻을 갖는 경우가 많으며, 구분 문자는 동일 또는 다른 뜻을 갖는 구성 요소의 배열로부터 각각의 구성 요소를 분리하는 데 쓰인다. 포트란의 COMMON문에서 예를 들면, COMMON/ CB₁/A,B(10), C/CB₂/M, N에서는 기호 ‘/’, ‘,’가 구분 문자이다.

padding
webopedia: Filling in unused space
empas: 채우기: 고정된 길이의 블록 또는 레코드의 사용하지 않는 기억 장소를 특정 정보, 즉 공백 등의 문자로 채우는 기법.



whitespace
webopedia:
Refers to all characters that appear as blanks on a display screen or printer. This includes the space character, the tab character, and sometimes other special characters that do not have a visual form (for example, the bell character and null character).

http://en.wikipedia.org/wiki/Whitespace_%28computer_science%29
whitespace is any single character or series of characters that represents horizontal or vertical space in typography.

LF = Line Feed
http://webopedia.com/TERM/L/line_feed.html
Often abbreviated LF, a line feed is a code that moves the cursor on a display screen down one line. In the ASCII character set, a line feed has a decimal value of 10.
On printers, a line feed advances the paper one line. Some printers have a button labeled LF that executes a line feed when pressed. (Note, however, that the printer must be in off-line mode to execute a line feed.)

raster
http://webopedia.com/TERM/r/raster.html
The rectangular area of a display screen actually being used to display images. The raster is slightly smaller than the physical dimensions of the display screen. Also, the raster varies for different resolutions. For example, VGA resolution of 640x480 on a 15-inch monitor produces one raster, whereas SVGA resolution of 1,024x768 produces a slightly different raster. Most monitors are autosizing, meaning that they automatically use the optimal raster depending on the monitor's size and the video adapter's resolution. In addition, most monitors have controls that allow you move the raster, resize it, and even to rotate it.


cf.
webopedia: The science of color



FILE* fopen()
파일을 여는 함수

FILE* fclose()
파일을 닫는 함수

int fscanf()
포맷에 따라 읽는 함수

int fprintf()
포맷에 따라 쓰는 함수

char* fgets()
'\n'을 기준으로 스트링을 읽어 들이는 함수

int fputs()
스트링을 출력하는 함수

size_t fread()
블럭 단위로 읽어 들이는 함수

size_t fwrite()
블럭 단위로 파일에 쓰는 함수


size_t
Unsigned integral type

size_t
corresponds to the integral data type returned by the language operator sizeof and is defined in the <cstddef> header file (among others) as an unsigned integral type.
It expresses a size or count in bytes.



posted by maetel
2008. 4. 14. 15:47 @GSMC/정문열: Generative Art
Head First Java 개정판
68쪽

인스턴스 변수 - 객체에서 자신에 대해 아는 것 (상태)
메소드 - 객체에서 자신이 하는 것 (행동)

인스턴스 변수 - 객체의 상태 - 데이터

"인스턴스(instance)란 객체(object)를 부르는 다른 이름이라고 생각하세요."

정 교수님:
C에서의 new와 Java에서의 new는 다르다.
C에서의 new는 memory를 allocate하는 데 반해,
Java에서의 new는 class의 constructor를 선언하는 것이다.

75쪽
자바 애플리케이션에서는 여러 클래스 가운데 한 클래스에 main 메소드가 있어야 한다. 그리고 그 클래스를 통해서 프로그램을 시작하게 된다.

클래스는 해당 클래스 유형의 객체를 만드는 방법을 설명하는 역할을 한다.



http://java.sun.com/javase/6/docs/api/java/lang/reflect/Array.html

http://java.sun.com/javase/6/docs/api/java/lang/Integer.html
noah:
Java에는 두 가지 종류의 int가 있다. 하나는 C에서와 같은 primitive 유형이고 다른 하나는 java.lang.Number를 상속하는 클래스 유형의 int이다.


'@GSMC > 정문열: Generative Art' 카테고리의 다른 글

변수  (0) 2008.05.17
class 5/1  (0) 2008.05.01
[이선애] study 1  (0) 2008.03.28
class 3/27  (0) 2008.03.27
tree (data structure)  (0) 2008.03.24
posted by maetel

(이전 수업 이어서) 의자 만들기

바퀴

* duplicate (mirror)
scale 값 -로 변경

과제: (3주 후: 4월 30일까지)
자기 방 만들어 오기

------
플로피 디스크 만들기

snap (마야 최고의 기능)
단축키: x(grid) c(curve) v(vertex)

1)
오브젝트 선택 > x 누른 상태로 MMB 마우스 살짝 움직이면
원하는 위치의 그리드로 자동 이동
: pivot을 이동하거나 오브젝트들을 arrange할 때 많이 쓴다

2)
오브젝트 선택 > move 툴 선택 > 이동할 축 선택 활성화
> v 키 누른 채로> 기준 vertex를 MMB로 클릭


polygon> boolean >
- union 잘 사용하지 않는다. (대신 combine 사용)
- difference 많이 사용한다.
- interaction 잘 사용하지 않는다.
되도록 boolean을 사용하지 말자. (마야 최악의 기능)

다면체 만들기
polygons>create polygon> LMB 클릭들 > enter (면 생성) >exclude face

다각형 안에 구멍 뚫기
polygons>create polygon >LMB 클릭들 (닫지 않은 채)
> ctrl 키를 누른 상태로 > LMB 클릭들....

edge 모드에서 모든 edge 선택 후 extrude
(아랫면이 생기지 않는다.)

오브젝트의 (면 삭제 후) 뚫린 면 막아 주기:
polygons> append to polygon tool > 커서가 바뀌면
한쪽 edge 선택 후 반대편 edge 선택

Tool의 반복은  y키 / 다른 명령어의 반복은 g 키
 
오브젝트의 edge 모드에서 전체 edge 선택
> ctrl 키를 누른 상태에서 가운데 edge 선택 (선택한 edge만 해제됨)
> (side view에서) ctrl 키 누른 상태에서 Mdrag로 윗면 선택 (윗면의 edge들 해제)
> (남은 아랫면 edge만 선택된 상태에서) extrude edge

(scale -y로) duplicate
> (insert키 눌러) 복사된 오브젝트의 pivot의 y축을 윗면으로 이동 (c키+MMB)
> 복사된 오브젝트 선택 후, move 상태에서 y축 선택
> c키 누른 상태에서 원래 오브젝트의 하단면의 edge를 선택


'@GSMC > 정재환: 3D Modeling&Rendering' 카테고리의 다른 글

class 7 - 돌고래 완성  (0) 2008.05.02
class 6 - dolphin  (0) 2008.04.25
class 5 - 키보드 만들기  (0) 2008.04.18
class 3 - 의자 만들기  (0) 2008.04.04
class 2 - 컴퓨터 모니터 만들기  (0) 2008.03.28
posted by maetel

for statement

to execute a block of  code for a specified number of times

for (initial-statement; condition; iteration-statement)
    body-statement;

equivalent to:
initial-statement;
while (condition) {
    body-statement;
    iteration-statement;
}


control variable
wikipedia: In programming, a control variable is a program variable that is used to regulate the flow of control of the program. For example, a loop control variable is used to regulate the number of times the body of a program loop is executed; it is incremented (or decremented when counting down) each time the loop body is executed.


switch statement

case label
default label

ref.    http://cplusplus.com/doc/tutorial/control.html
Its objective is to check several possible constant values for an expression. Something similar to what we did at the beginning of this section with the concatenation of several if and else if instructions.

Notice that switch can only be used to compare an expression against constants. Therefore we cannot put variables as labels (for example case n: where n is a variable) or ranges (case (1..3):) because they are not valid C++ constants.

If you need to check ranges or values that are not constants, use a concatenation of if and else if statements.

ref.   http://www.cprogramming.com/reference/switch.html
The braces are always needed following the switch statement. No braces are needed following any case. If the variable is equal to one of the values following a case, then the code following the case is executed. Execution will "fall through" from one case statement to the next, executing all code following the case statement, including code following other case statements and the default statement. The prevent falling through, include break;at the end of any code block. The default case will execute in the case that no other case is true.

ref.   http://www.cprogramming.com/tutorial/lesson5.html
Switch case statements are a substitute for long if statements that compare a variable to several "integral" values ("integral" values are simply values that can be expressed as an integer, such as the value of a char).

An important thing to note about the switch statement is that the case values may only be constant integral expressions.

ref.    http://en.wikipedia.org/wiki/Switch_statement
Its purpose is to allow the value of a variable or expression to control the flow of program execution.

cf. the switch statement in Java
A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Classes and Inheritance) and a few special classes that "wrap" certain primitive types: Character, Byte, Short, and Integer (discussed in Simple Data Objects ).

cf. switch() in Processing
Program controls jumps to the case with the same value as the expression. All remaining statements in the switch are executed unless redirected by a break. Only primitive datatypes which can convert to an integer (byte, char, and int) may be used as the expression parameter. The default is optional.

A break statement inside a switch tells the computer to continue execution after the switch. If a break statement is not there, execution will continue with the next statement.    (121쪽)



switch, break, and continue


'@GSMC > 서용덕: DMD Programming' 카테고리의 다른 글

to calculate the exponent of a power number  (0) 2008.04.16
week 6 review  (0) 2008.04.16
[Steve Oualline] 7. Programming Process  (0) 2008.04.05
week 4 review  (0) 2008.03.27
[Steve Ouallline] 6. Decision and Control Statements  (0) 2008.03.25
posted by maetel

setting up

unix 명령어
rm - 파일 지우기
mkdir - 디렉토리(폴더) 만들기
rmdir - 디렉토리(폴더) 지우기


module

Code design should include major algorithms, module definitions, file formats, and data structures.   (96쪽)

The code would be broken up into modules.    (98쪽)

그니까 대체 모듈이 뭐냐고~ 예전부터 애매모호하다.
In software, a module is a part of a program. Programs are composed of one or more independently developed modules that are not combined until the program is linked. A single module can contain one or several routines.

link
In programming, the term link refers to execution of a linker.

사용자 삽입 이미지

linker
Also called link editor and binder, a linker is a program that combines object modules to form an executable program. Many programming languages allow you to write different pieces of code, called modules, separately. This simplifies the programming task because you can break a large program into small, more manageable pieces. Eventually, though, you need to put all the modules together. This is the job of the linker.
In addition to combining modules, a linker also replaces symbolic addresses with real addresses. Therefore, you may need to link a program even if it contains only one module.


register (98쪽)

동아프라임:【컴퓨터】 레지스터 《CPU가 적은 양의 데이터나 처리하는 동안의 중간 결과를 일시적으로 저장하기 위해 사용하는 고속의 기억회로》
webopedia: A, special, high-speed storage area within the CPU. All data must be represented in a register before it can be processed. For example, if two numbers are to be multiplied, both numbers must be in registers, and the result is also placed in a register. (The register can contain the address of a memory location where data is stored rather than the actual data itself.)
The number of registers that a CPU has and the size of each (number of bits) help determine the power and speed of a CPU. For example a 32-bit CPU is one in which each register is 32 bits wide. Therefore, each CPU instruction can manipulate 32 bits of data.
Usually, the movement of data in and out of registers is completely transparent to users, and even to programmers. Only assembly language programs can manipulate registers. In high-level languages, the compiler is responsible for translating high-level operations into low-level operations that access registers.

사용자 삽입 이미지

메모리는 CPU 밖에 있고 레지스터는 CPU 안에 있는 것인가 보다.


Good communication is the key to good programming, and the more you can show someone the better.   (100쪽)


compilation

unix 명령어 - make
make uses the modification dates of the files to determine whether or not a compile is necessary. Compilation creates an object file. (The modification date of the object file is later than the modification date of its source. If the source was modified after the object, make recompiles the object.)   (103-104쪽)


Testing

One of the advantages of making a small working prototype is that we can isolate errors early.    (104쪽)


Debugging

Run the program and keep putting in printf statements until you isolate the area in the program that contains the mistake.

Maintenance

Revisions



rand()
Generate random number

random.c   http://fxr.watson.org/fxr/source/libkern/random.c


'@GSMC > 서용덕: DMD Programming' 카테고리의 다른 글

week 6 review  (0) 2008.04.16
[Steve Oualline] 8. More Control Statements  (0) 2008.04.06
week 4 review  (0) 2008.03.27
[Steve Ouallline] 6. Decision and Control Statements  (0) 2008.03.25
week 3 review  (0) 2008.03.22
posted by maetel

1.
edit>duplicate (*시험)
:options
copy로 적용하면 별개의 오브젝트
instance로 적용하면 원본과 연결되어 데이터를 더 차지하게 되며
 parent를 component 모드에서 형태 변화를 주면 따라서 변한다.

2.
pivot point
모든 오브젝트가 가지고 있는 중심점
move 모드에서 insert 키 : pivot 표시

3.
밴드 조절자
edge 활성화: animation 모드>deform>create nonlinear>band

4.smooth
:각각의 edge를 반으로 나누어 준다.
extrude:면을 증가시킨 후 smooth를 주면
다른 정도로 smooth가 일어나 질감을 줄 수 있다.

5.
polygons>
tool options> keep faces together 선택(해제 후 extrude하면
면이 각각 분할된다.)

6. 사슬
create cylinder > animation 모드: deform > create nonlinear
> delete by history

'@GSMC > 정재환: 3D Modeling&Rendering' 카테고리의 다른 글

class 7 - 돌고래 완성  (0) 2008.05.02
class 6 - dolphin  (0) 2008.04.25
class 5 - 키보드 만들기  (0) 2008.04.18
class 4 - 플로피 디스크  (0) 2008.04.11
class 2 - 컴퓨터 모니터 만들기  (0) 2008.03.28
posted by maetel

1. create
2. inputs > shape >
click heght -> MMB on window  


making a tap
extrude -> push in -> extrude -> reduce size -> extrude -> push in  

'g' - 방금 전에 실행한 명령어의 단축키

'@GSMC > 정재환: 3D Modeling&Rendering' 카테고리의 다른 글

class 7 - 돌고래 완성  (0) 2008.05.02
class 6 - dolphin  (0) 2008.04.25
class 5 - 키보드 만들기  (0) 2008.04.18
class 4 - 플로피 디스크  (0) 2008.04.11
class 3 - 의자 만들기  (0) 2008.04.04
posted by maetel
2008. 3. 28. 12:59 @GSMC/정문열: Generative Art
2008-03-28 금 11시 @504

Data Type
1) boolean
2) byte
3) char
4) int
5) float
6) color

* float이 memory를 훨씬 많이 차지하므로 정수는 int로 선언한다.
float f;
f = 2.7;
int i = (int) f;  //i=2가 된다.

똑같은 성질을 가지는 변수들이 여러 개일 때 array를 쓴다.
1024*768 (1280*1024)

변수명 붙이는 요령:
1. meaning
2. 소문자+대문자 (eg. roomTemp)


1) element: VarX (10%), VarY(30%), A(40%), B(20%)
2) array를 만든다 (길이 10)
     {VarX, VarY, VarY, VarY, A, A, A, A, B, B}
a) random number를 선택한다
rnum = random(0, 1)    (-> 항상 float)
rnum = random(0, 10)
(int) rnum
b) if (0~4) {VarX}



'@GSMC > 정문열: Generative Art' 카테고리의 다른 글

class 5/1  (0) 2008.05.01
Class와 Object  (0) 2008.04.14
class 3/27  (0) 2008.03.27
tree (data structure)  (0) 2008.03.24
class 3/20  (0) 2008.03.20
posted by maetel