KR100283071B1 - Fast Texture Mapping Method - Google Patents

Fast Texture Mapping Method Download PDF

Info

Publication number
KR100283071B1
KR100283071B1 KR1019980056142A KR19980056142A KR100283071B1 KR 100283071 B1 KR100283071 B1 KR 100283071B1 KR 1019980056142 A KR1019980056142 A KR 1019980056142A KR 19980056142 A KR19980056142 A KR 19980056142A KR 100283071 B1 KR100283071 B1 KR 100283071B1
Authority
KR
South Korea
Prior art keywords
triangle
texture mapping
modified
vertex
axis
Prior art date
Application number
KR1019980056142A
Other languages
Korean (ko)
Other versions
KR20000040483A (en
Inventor
장원영
전준현
최창석
Original Assignee
이계철
한국전기통신공사
최창석
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 이계철, 한국전기통신공사, 최창석 filed Critical 이계철
Priority to KR1019980056142A priority Critical patent/KR100283071B1/en
Publication of KR20000040483A publication Critical patent/KR20000040483A/en
Application granted granted Critical
Publication of KR100283071B1 publication Critical patent/KR100283071B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details

Abstract

1. 청구범위에 기재된 발명이 속하는 기술분야1. TECHNICAL FIELD OF THE INVENTION

본 발명은 컴퓨터 그래픽에 의한 동영상 생성에 관한 것으로서, 특히 텍스처 매핑 방법에 관한 것임.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to video generation by computer graphics, and more particularly to a texture mapping method.

2. 발명이 해결하고자 하는 기술적 과제2. Technical problem to be solved by the invention

본 발명은 연산량을 대폭으로 줄여서 전용보드를 이용하지 않고, 고속으로 텍스처 매핑을 하는 고속 텍스쳐 매핑 방법을 제공하고자 함.The present invention is to provide a high-speed texture mapping method that performs a texture mapping at a high speed without using a dedicated board by significantly reducing the amount of computation.

3. 발명의 해결 방법의 요지3. Summary of the Solution of the Invention

본 발명은 동영상 생성 시스템에서의 고속 텍스쳐 매핑 방법에 있어서, 원삼각형과 변형된 삼각형 꼭지점의 좌표가 입력되면, 변형된 삼각형을 분류하고, 변형된 삼각형의 꼭지점 데이터 구조를 설정하며, 상기 데이터 구조를 이용하여 y축을 따라 스캔하면서, 삼각형 변의 x축 스캔라인의 시점과 종점을 구하는 제1단계; x축 스캔라인을 따라서 각 화소마다 덧셈에 의하여 Z값을 구하는 제2단계; 삼각형내의 대응화소를 행렬연산에 의해 덧셈으로 구하는 제3단계; 및 테이블을 이용하여 휘도치를 보간 하고, 삼각형 내의 화소를 전부 스캔할 때까지 반복하는 제4단계를 포함함.According to the present invention, in the fast texture mapping method in a video generation system, when coordinates of a circular triangle and a modified triangle vertex are input, the modified triangle is classified, a vertex data structure of the modified triangle is set, and the data structure is determined. A first step of obtaining a start point and an end point of the x-axis scan line of the triangular side while scanning along the y-axis; obtaining a Z value by addition for each pixel along the x-axis scan line; A third step of adding the corresponding pixels in the triangle by matrix operation; And a fourth step of interpolating the luminance values using the table and repeating until all the pixels in the triangle are scanned.

4. 발명의 중요한 용도4. Important uses of the invention

본 발명은 고속 텍스쳐 매핑에 이용됨.The present invention is used for fast texture mapping.

Description

고속 텍스쳐 매핑 방법Fast Texture Mapping Method

본 발명은, 컴퓨터 그래픽에 의한 동영상 생성에 관한 것으로서, 특히 텍스처 매핑 방법 및 그것을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the generation of moving images by computer graphics, and more particularly to a computer readable recording medium recording a texture mapping method and a program for realizing the same.

일반적으로, 컴퓨터 그래픽스 분야에서는 도 1 과 같은 하드웨어 구성으로 텍스처 매핑을 사용하여 동영상 애니메이션을 생성하고 있다.In general, in the field of computer graphics, video animation is generated using texture mapping using the hardware configuration as shown in FIG. 1.

도 1 은 종래의 텍스처 매핑 전용보드를 이용한 동영상 생성 시스템의 일실시예 구성도이다.1 is a configuration diagram of a video generation system using a conventional texture mapping board.

즉, 카메라(101) 또는 스캐너(102)로 입력되는 사진이나 컴퓨터(103)에 생성된 영상을 이용하여 텍스처 매핑을 하여 여러 가지 애니메이션을 제작하고 있다.That is, various animations are produced by texture mapping using a picture input to the camera 101 or the scanner 102 or an image generated in the computer 103.

실시간 애니메이션을 위해서는 고속 텍스처 매핑이 필요하다. 현재는 고속 텍스처 매핑은 일반 중앙 처리 장치(CPU)(104)만으로는 연산량이 많아 고속 텍스처 매핑이 곤란하기 때문에, 특별한 전용 보드(105)를 이용하여 고속 텍스처 매핑을 실현하고 있다.Fast texture mapping is required for real-time animation. Since high speed texture mapping currently requires only a large amount of computation with only the central processing unit (CPU) 104, high speed texture mapping is difficult. Therefore, high speed texture mapping is realized using a special dedicated board 105.

도 2 는 종래의 텍스쳐 매핑을 이용한 동영상 애니메이션 생성의 일실시예 흐름도이다.2 is a flowchart illustrating an embodiment of generating a video animation using a conventional texture mapping.

3차원 형상모델(202)을 변형한 후(203), 원영상(201)의 텍스처를 매핑하여(204), 동영상 애니메이션(205)을 생성하고 있다. 즉, 변형된 형상모델에 원영상의 텍스처를 매핑하면, 변형된 영상을 합성할 수 있다.After deforming the 3D shape model 202 (203), the texture of the original image 201 is mapped (204) to generate a video animation (205). That is, by mapping the texture of the original image to the deformed shape model, the deformed image may be synthesized.

3차원 영상모델의 동작 또는 시점 변화에 따라, 3차원 모델을 점차로 변형하여, 텍스처 매핑하면 동영상 애니메이션을 얻을 수 있다.As the motion or viewpoint of the 3D image model changes, the 3D model may be gradually transformed and texture mapped to obtain a video animation.

본 발명은 종래의 텍스처 매핑 방법에 있어서 연산량을 대폭으로 줄여서 전용보드(105)를 이용하지 않고, 고속으로 텍스처 매핑을 하는 방법을 개발한 것이다. 일반적인 텍스처 매핑의 상세한 흐름도는 도 3 과 같다.The present invention has developed a method of texture mapping at a high speed without using a dedicated board 105 by greatly reducing the amount of computation in the conventional texture mapping method. 3 is a detailed flowchart of general texture mapping.

도 3 은 종래의 텍스쳐 매핑의 일실시예 상세 흐름도이다.3 is a detailed flowchart of an embodiment of a conventional texture mapping.

텍스처 매핑의 대상이 되는 삼각형의 방향이 전면을 향하고 있는지 후면을 향하고 있는지를 판단한다(301). 즉, 삼각형의 법선 벡터의 Z값이 양인지 음인지를 판단한다.It is determined whether the direction of the triangle that is the texture mapping object is facing the front or the rear (301). That is, it is determined whether the Z value of the triangle normal vector is positive or negative.

Z값이 양이면 전면을 향하고 있고, 음이면 후면을 향하고 있다. 전면을 향하고 있다면, 다각형내의 화소에 대하여 Z버퍼를 이용하여 3차원상의 전후관계를 판단한다(303). 이제까지 그려진 화소중 가장 전면에 있는 화소에 대하여 화소간 대응점을 산출한 후, 휘도치를 보간 한다.Positive values are toward the front and negative sides toward the back. If facing toward the front side, the front and rear relationship of the three-dimensional image is determined using the Z buffer for the pixel in the polygon (303). After calculating the correspondence point between pixels with respect to the pixel which is the frontmost among the pixels drawn so far, the luminance value is interpolated.

본 발명에서는 이들 텍스처 매핑의 과정에서 화소간 대응점의 산출(302), Z버퍼링과 Z값의 산출(303), 휘도치의 보간(304)에 대해서 고속 알고리즘을 제안한다.In the present invention, a high-speed algorithm is proposed for the calculation of the correspondence point between the pixels 302, the calculation of the Z-buffer and Z value 303, and the interpolation 304 of the luminance value.

도 4a 및 도 4b 는 종래의 삼각형의 텍스쳐 매핑의 일실시예 개념도로서, 도 4a 는 원래의 형상모델의 삼각형에 대한 것이고, 도 4b 는 변형된 형상모델의 삼각형에 대한 것이다.Figures 4a and 4b is a conceptual diagram of an embodiment of the texture mapping of a conventional triangle, Figure 4a is for the triangle of the original shape model, Figure 4b is for the triangle of the modified shape model.

즉, 도 4a 는 삼각형 A B C내에 속해 있는 화소를, 도 4b 는 삼각형A' B' C' 내에 있는 화소로 매핑하는 것이다.That is, FIG. 4A maps a pixel belonging to the triangle A B C and FIG. 4B maps a pixel belonging to the triangle A 'B' C '.

삼각형 A B C 는 원형상모델의 일부이며, 삼각형 A' B' C'는 변형된 형상모델에서 삼각형 A B C 에 대응되고 있다.Triangle A B C is part of the circular model, and triangle A 'B' C 'corresponds to triangle A B C in the modified shape model.

점 A, B, C는 삼각형 A B C의 정점이고, 점 A',B',C'는 삼각형 A'B'C'의 정점이다.Points A, B, and C are the vertices of triangle A B C, and points A ', B', and C 'are the vertices of triangle A'B'C'.

먼저, 삼각형 A'B'C'내의 화소에 대한 삼각형 A B C내의 대응위치를 구한다. 대응 위치 산출을 위해 다음의 (수학식 1) 및 (수학식 2)를 사용하고 있다.First, the corresponding position in triangle A B C with respect to the pixel in triangle A'B'C 'is obtained. Equations 1 and 2 are used to calculate the corresponding positions.

p=s u+tp = s u + t

p′= s u′+ t v′p ′ = s u ′ + t v ′

위 (수학식 1)에서의 u,v,p 및 (수학식 2)에서의 u',v',p'는 다음의 (수학식 3) 및 (수학식 4)와 같다.U, v, p in (Equation 1) and u ', v', p 'in (Equation 2) is the same as the following (Equation 3) and (Equation 4).

u=A-C, v=B-C, p=P-Cu = A-C, v = B-C, p = P-C

u′=A′-C′, v′=B′-C′, p′=P′-C′u ′ = A′-C ′, v ′ = B′-C ′, p ′ = P′-C ′

또한 위 (수학식 3)에서의 u, v 및 (수학식 4)에서의 u',v'는 다음과 같다.In addition, u, v in Equation 3 and u ', v' in Equation 4 are as follows.

즉, u=(vx,uy)T, v=(vx,vy)T,u′=(u′x,u′y)T, v′=(v′x,vy)T 이다.In other words, u = (v x , u y ) T , v = (v x , v y ) T, u ′ = (u ′ x , u ′ y ) T , v ′ = (v ′ x , v y ) T to be.

삼각형 A' B' C'내의 화소를 빠짐없이 텍스처 매핑하기 위하여, 대체로 변형된 삼각형 A' B' C의 y축을 따라 스캔해가면서 역 매핑을 사용하고 있다.In order to seamlessly texture-map the pixels in triangle A 'B' C ', we use inverse mapping by scanning along the y-axis of the modified triangle A' B 'C.

즉, (수학식 2)로부터, s, t를 구한 다음, (수학식 1)을 이용하여 P'의 대응점 P를 구하고 있다. (수학식 2)에서 s, t는 다음의 (수학식 5)에서와 같이 구한다.That is, s and t are calculated from (Equation 2), and then the corresponding point P of P 'is calculated using (Equation 1). In Equation 2, s and t are obtained as in Equation 5 below.

위 (수학식 5)와 같이 구하기 위해서는 곱셈 6회와 덧셈3회가 필요하다. 또,P를 구하기 위해서는 곱셈 4회와 덧셈2회가 필요하다.In order to obtain the above equation (5), 6 multiplications and 3 additions are required. In order to find P, four multiplications and two additions are required.

즉, 두 삼각형간의 대응점을 구하기 위해서는 총 10회의 곱셈과 5회의 덧셈이 필요하다. 본 발명의 목적은 곱셈을 없애고 덧셈의 수를 줄이면서 대응점을 찾는 알고리즘을 개발하여, 텍스처 매핑을 고속화하려 하고 있다.In other words, a total of 10 multiplications and 5 additions are required to find the corresponding points between the two triangles. An object of the present invention is to speed up texture mapping by developing an algorithm for finding correspondences while eliminating multiplication and reducing the number of additions.

Z버퍼링을 위해, P'에서의 Z값을 다음의 (수학식 6)에서와 같이,Z'A,Z'B,Z'C로부터 구한다. Z'A,Z'B,Z'C는 각각 점 A',B',C'의 Z좌표이다.For Z buffering, the Z value at P 'is obtained from Z' A , Z ' B , Z' C as in the following (Equation 6). Z ' A , Z' B and Z ' C are the Z coordinates of points A', B 'and C', respectively.

z′1=Z′A-Z′C, z′2=Z′B-Z′C z ′ 1 = Z ′ A -Z ′ C , z ′ 2 = Z ′ B -Z ′ C

z′=sz′1+tz′2 z ′ = sz ′ 1 + tz ′ 2

위 (수학식 7)의 Z'가 P'에서의 Z값이다. Z값을 구하기 위해서 2회의 곱셈과 2회의 덧셈이 필요하다.Z 'in Equation 7 is the Z value at P'. Two multiplications and two additions are needed to find the Z value.

일반적으로 점 P의 위치는 정수화소 위치가 아니다(도 4 참조).In general, the position of point P is not an integer pixel position (see FIG. 4).

여기서 m,n은 각각 x와 y를 넘지 않는 정수이다. 주변 정수위치의 화소치로부터 점 P의 위치의 휘도치는 도 5 와 같이 쌍1차 보간을 한다.Where m and n are integers not exceeding x and y, respectively. The luminance value of the position of the point P from the pixel value of the peripheral constant position performs bilinear interpolation as shown in FIG.

도 5 는 종래의 휘도치의 쌍 일차 보간의 일실시예 개념도.5 is a conceptual diagram of one embodiment of conventional bilinear interpolation of luminance values.

즉, I(m,n)과 I(m+1,n)을 이용하여 I(x,n)을 보간하고, I(m+1,n)과 I(m+1,n+1)을 이용하여 I(x,n+1)을 보간한 후, I(x,n)과 I(x,n+1)을 이용하여 I(x,y)를 보간하고 있다. 이것을 식으로 나타내면, 다음의 (수학식 8)과 같다.In other words, I (m, n) and I (m + 1, n) are used to interpolate I (x, n) and I (m + 1, n) and I (m + 1, n + 1) After I (x, n + 1) is interpolated, I (x, n) is interpolated using I (x, n) and I (x, n + 1). This is expressed by the following equation (8).

위 (수학식 8)에서, I(x, y) 는 P=(x, y)T점에서의 휘도치이다. 소요되는 계산량은 곱셈 6회, 덧셈 3회이다. 이와 같은 텍스처 매핑 과정에서 소요되는 총 계산량은 곱셈 18회, 덧셈 10회이다.In Equation (8) above, I (x, y) is a luminance value at P = (x, y) T point. The computation required is six multiplications and three additions. The total computations required for this texture mapping process are 18 multiplications and 10 additions.

즉, 상기한 바와 같이, 실시간 애니메이션을 위해서는 고속 텍스처 매핑이 필요하지만, 종래 기술에있어서의 고속 텍스처 매핑은 일반 중앙 처리 장치(CPU)만으로는 연산량이 많아, 고속 텍스처 매핑이 곤란하기 때문에 특별한 전용 보드를 이용하여야 하는 문제점이 있었다.In other words, as described above, high-speed texture mapping is required for real-time animation. However, in the conventional technology, high-speed texture mapping requires a large amount of computation using only a general CPU, and high-speed texture mapping is difficult. There was a problem that should be used.

상기 종래의 문제점을 해결하기 위하여 안출된 본 발명은, 종래의 텍스처 매핑 방법에 있어서의 연산량을 대폭으로 줄여서 전용보드를 이용하지 않고, 고속으로 텍스처 매핑을 하는 고속 텍스쳐 매핑 방법 및 그것을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체를 제공하는데 그 목적이 있다.SUMMARY OF THE INVENTION The present invention devised to solve the above-mentioned problems has a high-speed texture mapping method and a program for realizing the texture mapping at high speed without using a dedicated board by greatly reducing the amount of computation in the conventional texture mapping method. Its purpose is to provide a computer readable recording medium having recorded thereon.

도 1 은 종래의 텍스처 메핑 전용보드를 이용한 동영상 생성 시스템의 일실시예 구성도.1 is a configuration diagram of an embodiment of a video generating system using a conventional texture mapping board.

도 2 는 종래의 텍스쳐 매핑을 이용한 동영상 애니메이션 생성의 일실시예 흐름도.2 is a flowchart illustrating an embodiment of generating a video animation using a conventional texture mapping.

도 3 은 종래의 텍스쳐 매핑의 일실시예 상세 흐름도.Figure 3 is a detailed flowchart of one embodiment of a conventional texture mapping.

도 4a 및 도 4b 는 종래의 삼각형의 텍스쳐 매핑의 일실시예 개념도.4A and 4B are conceptual diagrams of one embodiment of a conventional triangular texture mapping.

도 5 는 종래의 휘도치의 쌍 일차 보간의 일실시예 개념도.5 is a conceptual diagram of one embodiment of conventional bilinear interpolation of luminance values.

도 6 은 본 발명에 따른 텍스쳐 매핑의 일실시예 흐름도.6 is a flow diagram of one embodiment of a texture mapping in accordance with the present invention.

도 7 은 본 발명이 적용되는 삼각형 종류의 일실시예 분류도.Figure 7 is a classification diagram of one embodiment of the triangle type to which the present invention is applied.

도 8 은 본 발명이 적용되는 삼각형의 일실시예 데이터 구조도.8 is an exemplary data structure diagram of a triangle to which the present invention is applied.

도 9 는 본 발명이 적용되는 휘도치 보간의 일실시예 개념도.9 is a conceptual diagram of an embodiment of luminance value interpolation to which the present invention is applied.

도 10 은 본 발명이 적용되는 휘도치 보간을 위한 일실시예 테이블.10 is an embodiment table for luminance value interpolation to which the present invention is applied.

도 11 은 본 발명이 적용되는 보간된 휘도치의 검색을 위한 일실시예 주소 테이블.11 is an embodiment address table for retrieving interpolated luminance values to which the present invention is applied.

상기 목적을 달성하기 위한 본 발명은, 동영상 생성 시스템에서의 고속 텍스쳐 매핑 방법에 있어서, 원삼각형과 변형된 삼각형 꼭지점의 좌표가 입력되면, 변형된 삼각형을 분류하고, 변형된 삼각형의 꼭지점 데이터 구조를 설정하며, 상기 데이터 구조를 이용하여 y축을 따라 스캔하면서, 삼각형 변의 x축 스캔라인의 시점과 종점을 구하는 제 1 단계; x축 스캔라인을 따라서 각 화소마다 덧셈에 의하여 Z값을 구하는 제 2 단계; 삼각형내의 대응화소를 행렬연산에 의해 덧셈으로 구하는 제 3 단계; 및 테이블을 이용하여 휘도치를 보간 하고, 삼각형 내의 화소를 전부 스캔할 때까지 제 1 단계부터 반복하는 제 4 단계를 포함한다.According to the present invention for achieving the above object, in the fast texture mapping method in the video generation system, when the coordinates of the original triangle and the modified triangle vertices are input, the modified triangle is classified, and the vertex data structure of the modified triangle is classified. A first step of obtaining a start point and an end point of an x-axis scan line of a triangular side while scanning along the y-axis using the data structure; obtaining a Z value by addition for each pixel along the x-axis scan line; A third step of adding the corresponding pixels in the triangle by matrix operation; And a fourth step of interpolating the luminance values using the table and repeating from the first step until all the pixels in the triangle are scanned.

또한 본 발명은, 동영상 생성 시스템에서의 고속 텍스쳐 매핑을 위하여, 대용량 프로세서를 구비한 동영상 생성 시스템에, 원삼각형과 변형된 삼각형 꼭지점의 좌표가 입력되면, 변형된 삼각형을 분류하고, 변형된 삼각형의 꼭지점 데이터 구조를 설정하며, 상기 데이터 구조를 이용하여 y축을 따라 스캔하면서, 삼각형 변의 x축 스캔라인의 시점과 종점을 구하는 제 1 기능; x축 스캔라인을 따라서 각 화소마다 덧셈에 의하여 Z값을 구하는 제 2 기능; 삼각형내의 대응화소를 행렬연산에 의해 덧셈으로 구하는 제 3 기능; 및 테이블을 이용하여 휘도치를 보간 하고, 삼각형 내의 화소를 전부 스캔할 때까지 제 1 기능부터 반복하는 제 4 기능을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체를 포함한다.In addition, the present invention, if the coordinates of the original triangle and the modified triangle vertices are input to the video generation system having a large capacity processor for fast texture mapping in the video generation system, classify the modified triangle, and A first function of setting a vertex data structure and finding a start point and an end point of an x-axis scan line of a triangle side while scanning along the y-axis using the data structure; a second function of obtaining a Z value by addition for each pixel along the x-axis scan line; A third function of obtaining corresponding pixels in the triangle by addition by matrix operation; And a computer-readable recording medium having recorded thereon a program for realizing a fourth function which interpolates the luminance values using a table and repeats the first function until all the pixels in the triangle are scanned.

이하 도 6 내지 도 11 을 참조하여 본 발명의 바람직한 일실시예를 상세히 설명한다.Hereinafter, a preferred embodiment of the present invention will be described in detail with reference to FIGS. 6 to 11.

도 6 은 본 발명에 따른 텍스쳐 매핑의 일실시예 흐름도이다.6 is a flowchart of an embodiment of a texture mapping according to the present invention.

도 4 에서 나타낸 바와 같이 원삼각형과 변형된 삼각형 꼭지점의 좌표가 입력되면(601), 삼각형의 꼭지점의 좌표를 정수화한 후(602), 변형된 삼각형을 도 7 과 같이 5개의 형으로 분류한다(603).As shown in FIG. 4, when coordinates of a circle triangle and a modified triangle vertex are input (601), the coordinates of the vertex of the triangle are integerized (602), and the modified triangle is classified into five types as shown in FIG. 7 ( 603).

분류된 삼각형의 꼭지점의 데이터 구조를 도 8 과 같이 설정한다(604). 원삼각형과 변형된 삼각형 사이의 변환 행렬을 계산한다(605).A data structure of the vertices of the classified triangle is set as shown in FIG. 8 (604). The conversion matrix between the original triangle and the modified triangle is calculated (605).

삼각형에 대하여 y축을 따라 아래로 내려가면서 시점과 종점의 x좌표를 계산한다(606). 도 4 의 삼각형 A'B'C'의 예를 들면, y축을 따라, 변 A'B' 와 변 A'C' 에서 각각 시점과 종점의 x좌표를 구한다.The x coordinate of the start point and the end point is calculated while descending along the y axis with respect to the triangle (606). For example, in the triangle A'B'C 'of FIG. 4, along the y-axis, the x coordinates of the start point and the end point are obtained at the sides A'B' and the sides A'C ', respectively.

시점과 종점사이를 x축을 따라 오른쪽으로 스캔하면서(607), 주목화소의 Z값을 1회의 덧셈만으로 주목화소의 기존의 Z값을 구하고(608), 새로운 Z값을 비교하여 새로운 Z값이 작으면 다음 화소를 스캔하고, 크면(609) 원삼각형의 대응위치를 산출한다(610). 대응위치 산출에서는 2회의 덧셈만을 이용하고 있다.Scanning between the start and end points along the x axis to the right (607), the existing Z value of the pixel of interest is obtained by adding one time to the Z value of the pixel of interest (608), and the new Z value is compared by comparing the new Z value. If it is, the next pixel is scanned and the corresponding position of the circular triangle is calculated (610). In the corresponding position calculation, only two additions are used.

원삼각형의 대응위치는 일반적으로 정수화소가 아니므로, 휘도치를 테이블을 이용하여 쌍 1차 보간을 한다(611). 이것은 (수학식 8)의 곱셈연산을 줄이기 위함이다.Since the corresponding positions of the circle triangle are generally not integer pixels, pair primary interpolation is performed using the luminance values table (611). This is to reduce the multiplication of (8).

x방향의 스캔이 끝나면, y축방향 다음 라인을 스캔한다(612). 삼각형 내의 화소를 전부 스캔하면(613), 다음 삼각형으로 넘어간다(614).After the scan in the x direction is finished, the next line in the y axis direction is scanned (612). When all the pixels in the triangle are scanned (613), the processing proceeds to the next triangle (614).

상기한 바와 같은 본 발명의 고속 텍스처 매핑 방법을 도 7 내지 도 11 을 참조하여 각 부문별로 좀더 상세히 설명한다.The fast texture mapping method of the present invention as described above will be described in more detail for each section with reference to FIGS. 7 to 11.

도 7 은 본 발명이 적용되는 삼각형 종류의 일실시예 분류도이고, 도 8 은 본 발명이 적용되는 삼각형의 일실시예 데이터 구조도이다. 또한, 도 9 는 본 발명이 적용되는 휘도치 보간의 일실시예 개념도이며, 도 10 은 본 발명이 적용되는 휘도치 보간을 위한 일실시예 테이블이고, 도 11 은 본 발명이 적용되는 보간된 휘도치의 검색을 위한 일실시예 주소 테이블이다.7 is a diagram illustrating an embodiment of triangular types to which the present invention is applied, and FIG. 8 is a diagram showing an embodiment data structure of a triangle to which the present invention is applied. 9 is a conceptual diagram of luminance interpolation to which the present invention is applied, FIG. 10 is an exemplary table for luminance value interpolation to which the present invention is applied, and FIG. 11 is an interpolated luminance to which the present invention is applied. Example address table for retrieval of values.

먼저 점 A', B', C'의 위치를 정수화한다(602). 삼각형 A', B', C'의 스캔 변환을 위하여 삼각형의 종류를 분류한다(603).First, the positions of points A ', B', and C 'are integerized (602). Types of triangles are classified for scan conversion of triangles A ', B', and C '(603).

삼각형은 도 7 과 같이 5개형으로 분류된다.Triangles are classified into five shapes as shown in FIG. 7.

즉, Ⅰ형은 하변이 수평선과 평행하며 나머지 꼭지점이 밑변의 상부에 있는 경우이고, Ⅱ형은 상변이 수평선과 평행하며 나머지 꼭지점이 밑변의 하부에 있는 경우이며, Ⅲ형은 삼각형의 꼭지점을 y값에 따라, 크기순으로 나열했을 때, 2번째의 꼭지점이 나머지 꼭지점을 연결한 직선의 오른쪽에 있는 경우이다. 또한, Ⅳ형은 Ⅲ형과 비슷하나, 2번째 꼭지점이 왼쪽에 있을 경우이고, V형은 세점이 일직선 상에 있는 경우이다.In other words, Type I is when the lower side is parallel to the horizontal line and the remaining vertices are on the upper side, and Type II is when the upper side is parallel to the horizontal line and the remaining vertices are on the lower side of the base. By value, when the second vertex is listed in size order, it is on the right side of the straight line connecting the remaining vertices. In addition, type IV is similar to type III, but the second vertex is on the left side, and type V is when three points are in a straight line.

삼각형이 종류에 따라 분류되면, 스캔변환을 위해 도 8 과 같은 데이터 구조를 갖는다. 도 8 과 같은 데이터 구조에 따라, 다음과 같이 스캔변환 한다(606).When triangles are classified according to types, they have a data structure as shown in FIG. 8 for scan conversion. According to the data structure of FIG. 8, scan conversion is performed as follows (606).

Ⅰ형은 ya부터 yb까지 y축을 따라 스캔해 가면서 상의 시점과 중점의 x좌표를 각각 구한다.Type I scans along y axis from y a to y b Find the x-coordinate of the viewpoint and the midpoint of the image respectively.

Ⅱ형은 직선 상의 x좌표를 구한다.Type II is straight Find the x-coordinate of the top.

Ⅲ형은 ya부터 yb까지 직선 상의 x좌표를 구한 후, yb+1부터 yc까지는 직선 상의 x좌표를 구한다.Type III is a straight line from y a to y b Find the x-coordinate of the phase and then the straight line from y b +1 to y c Find the x-coordinate of the top.

Ⅳ형은 Ⅲ형의 경우와 유사하게, ya부터 yb까지는 직선 를 따라 스캔변환하고, yb+1부터 yc까지는 직선 상의 x좌표를 구한다.Type IV is a straight line from y a to y b similarly to type III. Scan along the line, and from y b +1 to y c Find the x-coordinate of the top.

Ⅴ형은 스캔변환하지 않는다.Type V does not scan convert.

예를 들면, 제Ⅰ형의 직선 에서의 스캔라인의 시작점과 끝점의 x좌표는 디지털 차분 알고리즘(Digital Differential Algorithm : DDA)을 이용하여 다음의 (수학식 9) 및 (수학식 10)과 같이 구한다(606). 즉, 직선 의 k번째 스캔라인의 점을 Xk라 하면For example, straight line of type I The x-coordinates of the start point and the end point of the scan line in are obtained using the Digital Differential Algorithm (DDA) as shown in Equations 9 and 10 below (606). That is, straight When the point of the k-th scanning lines X k d

Yk=Yk-1+1Y k = Y k-1 +1

X0=Xa, Y0= Ya이고, mab는 직선 의 기울기이다. 어떤 y축에서 시점과 종점의 좌표가 구해지면, 각 화소에서 다음의 (수학식 11)에 의하여 Z값을 구한다. 즉, (수학식 7)을 변형하고, (수학식 5)를 대입하면X 0 = X a , Y 0 = Y a and m ab is a straight line Is the slope of. When the coordinates of the starting point and the ending point on the y axis are obtained, the Z value is obtained by the following equation (11) in each pixel. In other words, if you modify (7) and substitute (5)

z′=a1x′+a2y′z ′ = a 1 x ′ + a 2 y ′

단 a1, a2 는 다음의 (수학식 12)와 같다.Where a1 and a2 are as shown in Equation 12 below.

z′i=a1x′i+a2y′k z ′ i = a 1 x ′ i + a 2 y ′ k

z′i+1=a1x′i+1+a2y′k=z′i+a1 z ′ i + 1 = a 1 x ′ i + 1 + a 2 y ′ k = z ′ i + a 1

z′o=a1x′o+a2y′k z ′ o = a 1 x ′ o + a 2 y ′ k

위 식에서 x축을 따라 스캔하는 경우는 xi+1= xi+1 이므로, (수학식 14)와 같이 z'i의 계산에 덧셈 1회만이 필요하다. (수학식 15)의 z'0는 k번째 라인의 첫 번째 화소의 Z값이다.In the above formula, the scan along the x-axis is x i + 1 = x i +1, so only one addition is necessary to calculate z ' i as shown in Equation (14). Z ' 0 in (15) is the Z value of the first pixel of the k-th line.

도 4 의 P'=(x',y')T에 대한 대응위치 P=(x, y)T를 구하기 위해 (수학식 1)을 정리하여, s,t 대신에 (수학식 5)를 대입하면 다음의 (수학식 16) 내지 (수학식 19)와 같다.For the Figure 4 P '= (x', y ') corresponding to the location of the T P = (x, y) to obtain a T (Equation 1) to clean up to, substituted for (Equation 5) instead of s, t If the following equations (16) to (19).

이때 b11, b12, b21, b22는 다음의 (수학식 20)과 같다.B 11 , b 12 , b 21 , and b 22 are represented by Equation 20 below.

x축을 따라 스캔하는 경우는 xk+1= xk+1 이기 때문에 원삼각형에서의 대응점의 위치는 (수학식 18)과 같이 산출된다. 즉, 2회의 덧셈만으로 대응위치가 산출된다(610).Since the scan along the x-axis is x k + 1 = x k +1, the position of the corresponding point in the circle triangle is calculated as shown in Equation (18). That is, the corresponding position is calculated only by two additions (610).

대응위치 (Xi, Yi)가 산출되면, (Xi, Yi)는 정수 위치가 아니기 때문에 주변의 정수화소로부터 테이블을 이용하며 휘도치를 보간 한다(도 5 참조).When the corresponding position (X i , Y i ) is calculated, since (X i , Y i ) is not an integer position, the luminance value is interpolated using a table from surrounding integer pixels (see Fig. 5).

도 9 는 휘도치 보간을 위한 개념도이다. I(x,y)의 휘도치를 구하는데 있어서 곱셈을 줄이고, 테이블을 이용하여 보간한다(611).9 is a conceptual diagram for luminance value interpolation. In calculating the luminance value of I (x, y), multiplication is reduced and interpolated using a table (611).

즉, 휘도치 I(x,n)는 주변 정수화소 위치 (m,n)의 휘도치 I(m,n)과 화소 위치 (m+1,n)의 휘도치 I(m+1,n)으로부터 보간 된다. 여기서 m은 실수 x를 넘지 않는 정수이다. 먼저 xf는 x의 소수점 이하의 값에 100을 곱한 후 (수학식 23)과 같이 정수값만을 취한다.That is, the luminance value I (x, n) is the luminance value I (m, n) at the peripheral integer pixel position (m, n) and the luminance value I (m + 1, n) at the pixel position (m + 1, n). Interpolated from. Where m is an integer that does not exceed real x. First, x f multiplies the value of the decimal point of x by 100 and then takes only an integer value as shown in Equation 23.

이 보간을 위해 도 10 과 같은 휘도치 보간을 위한 테이블(IT)과, 도 11 과 같은 보간된 휘도치의 테이블의 주소 검색을 위한 테이블(AT)을 준비하고 있다.For this interpolation, a table IT for luminance value interpolation as shown in FIG. 10 and a table AT for address search of the table of interpolated luminance values as shown in FIG. 11 are prepared.

휘도치 보간을 위한 테이블(IT)은 1부터 255의 100등분한 값을, 각각의 라인에 보관하는 테이블이다.A table (IT) for interpolation of luminance values is a table for storing a value equal to 100 from 1 to 255 in each line.

보간된 휘도치의 테이블의 주소 검색을 위한 테이블(AT)은 보간된 휘도치 값이 들어있는 테이블(IT)의 주소를 찾기 위한 테이블로서 0~254에 100을 곱한 값이 들어있다. 휘도치의 보간 방법은 다음의 (수학식 23) 및 (수학식 24)와 같다.The table AT for retrieving an address of a table of interpolated luminance values is a table for finding an address of a table IT including interpolated luminance values, and contains 0 to 254 multiplied by 100. The interpolation method of the luminance values is shown in Equations 23 and 24 below.

xf=[(x-m)*100]x f = [(xm) * 100]

Id=I(m+1,n)-I(m,n)I d = I (m + 1, n) -I (m, n)

Addr을 도 10 의 테이블 AT의 |Id|번째 값이라고 한다. 또, Value를 테이블 IT의 (Addr + xf)번째 값이라고 하면, I(x,n)은 Id1〉0이면, I(m,n)+Value이고, Id1〈0 이면, I(m,n) - Value이고, Id1=0 이면, I(m,n)이다. I(x,n+1)을 같은 방법으로 구할 수 있다. 나아가서, I(x,n+1)과 I(x,n)을 이용하여 같은 방법으로 보간 하면 I(x,y)를 구할 수 있다.Addr is called | I d | th value of the table AT of FIG. If Value is the (Addr + x f ) th value of the table IT, I (x, n) is I (m, n) + Value if I d1 > 0, and I (m if I d1 <0. , n)-Value, and if I d1 = 0, then I (m, n). I (x, n + 1) can be found in the same way. Furthermore, if I (x, n + 1) and I (x, n) are interpolated in the same way, I (x, y) can be obtained.

이와 같이 연산함으로서 곱셈 2회와 덧셈 7회로 휘도치의 보간이 가능하다. 좀더 세밀한 보간을 위해서 휘도치 보간 테이블(IT)을 좀더 세밀하게 하면 된다.By calculating in this way, the luminance value can be interpolated twice by two multiplications and seven additions. For more detailed interpolation, the luminance value interpolation table (IT) can be further refined.

상기방법을 이용하면, 곱셈 2회와 덧셈 10회의 연산으로 1화소에 대한 텍스처 매핑이 가능하다.Using this method, texture mapping for one pixel is possible with two multiplications and ten additions.

이상에서 설명한 본 발명은, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에 있어 본 발명의 기술적 사상을 벗어나지 않는 범위내에서 여러 가지 치환, 변형 및 변경이 가능하므로 전술한 실시예 및 첨부된 도면에 한정되는 것이 아니다.The present invention described above is capable of various substitutions, modifications, and changes without departing from the spirit of the present invention for those skilled in the art to which the present invention pertains, and the above-described embodiments and accompanying It is not limited to the drawing.

상기한 바와 같은 본 발명은, 컴퓨터에 내장되어 있는 중앙 처리 장치(CPU)만을 이용하여 고속 텍스처 매핑이 가능하기 때문에, 실시간 동영상 애니메이션에서 특별한 전용보드를 이용하지 않을 수 있으며, 고속 영상 합성 등에 이용될 수 있는 우수한 효과가 있다.As described above, since the high speed texture mapping is possible using only a central processing unit (CPU) built into the computer, a special dedicated board may not be used in real-time video animation, and it may be used for high speed image synthesis. It has an excellent effect.

Claims (6)

동영상 생성 시스템에서의 고속 텍스쳐 매핑 방법에 있어서,In the fast texture mapping method in the video generation system, 원삼각형과 변형된 삼각형 꼭지점의 좌표가 입력되면, 변형된 삼각형을 분류하고, 변형된 삼각형의 꼭지점 데이터 구조를 설정하며, 상기 데이터 구조를 이용하여 y축을 따라 스캔하면서, 삼각형 변의 x축 스캔라인의 시점과 종점을 구하는 제 1 단계;When the coordinates of the original triangle and the modified triangle vertices are input, the modified triangles are classified, the vertex data structures of the modified triangles are set, and the data triangles are scanned along the y axis, and the x-axis scan lines of the triangle sides are scanned. A first step of finding start and end points; x축 스캔라인을 따라서 각 화소마다 덧셈에 의하여 Z값을 구하는 제 2 단계;obtaining a Z value by addition for each pixel along the x-axis scan line; 삼각형내의 대응화소를 행렬연산에 의해 덧셈으로 구하는 제 3 단계; 및A third step of adding the corresponding pixels in the triangle by matrix operation; And 테이블을 이용하여 휘도치를 보간 하고, 삼각형 내의 화소를 전부 스캔할 때까지 제 1 단계부터 반복하는 제 4 단계Fourth step of interpolating luminance values using a table and repeating from the first step until all pixels in the triangle are scanned 를 포함하는 고속 텍스쳐 매핑 방법.Fast texture mapping method comprising a. 제 1 항에 있어서,The method of claim 1, 상기 제 1 단계는,The first step is, 원삼각형과 변형된 삼각형 꼭지점의 좌표가 입력되면, 변형된 삼각형의 꼭지점의 좌표를 정수화 하는 제 5 단계;A fifth step of integerizing coordinates of the vertex of the modified triangle when the circle triangle and the modified triangle vertex are inputted; 변형된 삼각형을 각각의 유형으로 분류하는 제 6 단계;A sixth step of classifying the modified triangle into each type; 분류된 삼각형의 꼭지점의 데이터 구조를 설정하는 제 7 단계;A seventh step of setting a data structure of vertices of the sorted triangles; 원삼각형과 변형된 삼각형 사이의 변환 행렬을 계산하는 제 8 단계; 및An eighth step of calculating a transformation matrix between the circular triangle and the modified triangle; And 삼각형에 대하여 y축을 따라 아래로 내려가면서 시점과 종점의 x좌표를 계산하는 제 9 단계The ninth step of calculating the x-coordinates of the start and end points while descending along the y axis with respect to the triangle 를 포함하는 고속 텍스쳐 매핑 방법.Fast texture mapping method comprising a. 제 2 항에 있어서,The method of claim 2, 상기 제 6 단계의 분류는,The sixth step of classification, 제 1 형은 하변이 수평선과 평행하며 나머지 꼭지점이 밑변의 상부에 있는 경우, 제 2 형은 상변이 수평선과 평행하며 나머지 꼭지점이 밑변의 하부에 있는 경우, 제 3 형은 삼각형의 꼭지점을 y값에 따라, 크기순으로 나열했을 때, 2번째의 꼭지점이 나머지 꼭지점을 연결한 직선의 오른쪽에 있는 경우, 제 4 형은 제 3 형과 비슷하나, 2번째 꼭지점이 왼쪽에 있을 경우, 제 5 형은 세점이 일직선 상에 있는 경우로 분류하는 것을 특징으로하는 고속 텍스쳐 매핑 방법.Type 1 means that the lower edge is parallel to the horizontal line and the remaining vertices are on top of the base, while type 2 means that the upper edge is parallel to the horizon and the remaining vertices are on the bottom of the base, and type 3 represents the vertex of the triangle as the y value. According to size, if the second vertex is to the right of the straight line connecting the remaining vertices, type 4 is similar to type 3, but if the second vertex is to the left, type 5 Fast texture mapping method characterized in that is classified as the case where three points are in a straight line. 제 1 항에 있어서,The method of claim 1, 상기 제 2 단계는, x축 스캔라인을 따라서 각 화소마다 1회의 덧셈에 의하여 Z값을 구하는 것을 특징으로 하는 고속 텍스쳐 매핑 방법.2. The method of claim 2, wherein the Z value is obtained by one addition for each pixel along the x-axis scan line. 제 1 항 내지 제 4 항 중 어느 한 항에 있어서,The method according to any one of claims 1 to 4, 상기 제 3 단계는, 삼각형내의 대응화소를 행렬연산에 의해 2회의 덧셈으로 구하는 것을 특징으로 하는 고속 텍스쳐 매핑 방법.The third step is the fast texture mapping method, characterized in that to obtain the corresponding pixel in the triangle by two additions by matrix operation. 동영상 생성 시스템에서의 고속 텍스쳐 매핑을 위하여, 대용량 프로세서를 구비한 동영상 생성 시스템에,For a high speed texture mapping in a video generation system, in a video generation system having a large processor, 원삼각형과 변형된 삼각형 꼭지점의 좌표가 입력되면, 변형된 삼각형을 분류하고, 변형된 삼각형의 꼭지점 데이터 구조를 설정하며, 상기 데이터 구조를 이용하여 y축을 따라 스캔하면서, 삼각형 변의 x축 스캔라인의 시점과 종점을 구하는 제 1 기능;When the coordinates of the original triangle and the modified triangle vertices are input, the modified triangles are classified, the vertex data structures of the modified triangles are set, and the data triangles are scanned along the y axis, and the x-axis scan lines of the triangle sides are scanned. A first function of finding a start point and an end point; x축 스캔라인을 따라서 각 화소마다 덧셈에 의하여 Z값을 구하는 제 2 기능;a second function of obtaining a Z value by addition for each pixel along the x-axis scan line; 삼각형내의 대응화소를 행렬연산에 의해 덧셈으로 구하는 제 3 기능; 및A third function of obtaining corresponding pixels in the triangle by addition by matrix operation; And 테이블을 이용하여 휘도치를 보간 하고, 삼각형 내의 화소를 전부 스캔할 때까지 제 1 기능부터 반복하는 제 4 기능Fourth function that interpolates the luminance values using a table and repeats from the first function until all pixels in the triangle are scanned 을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체.A computer-readable recording medium having recorded thereon a program for realizing this.
KR1019980056142A 1998-12-18 1998-12-18 Fast Texture Mapping Method KR100283071B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019980056142A KR100283071B1 (en) 1998-12-18 1998-12-18 Fast Texture Mapping Method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019980056142A KR100283071B1 (en) 1998-12-18 1998-12-18 Fast Texture Mapping Method

Publications (2)

Publication Number Publication Date
KR20000040483A KR20000040483A (en) 2000-07-05
KR100283071B1 true KR100283071B1 (en) 2001-04-02

Family

ID=19563714

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019980056142A KR100283071B1 (en) 1998-12-18 1998-12-18 Fast Texture Mapping Method

Country Status (1)

Country Link
KR (1) KR100283071B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1860614A1 (en) 2006-05-26 2007-11-28 Samsung Electronics Co., Ltd. 3-Dimensional Graphics Processing Method, Medium and Apparatus Performing Perspective Correction
KR100908123B1 (en) * 2006-05-26 2009-07-16 삼성전자주식회사 3D graphics processing method and apparatus for performing perspective correction

Also Published As

Publication number Publication date
KR20000040483A (en) 2000-07-05

Similar Documents

Publication Publication Date Title
US4975976A (en) Image transformation method and device
JP3203160B2 (en) Volume rendering apparatus and method
US7924278B2 (en) Real-time GPU rendering of piecewise algebraic surfaces
JP2000227966A (en) 3d computer graphics processor and processing method
CN104732479B (en) Resizing an image
JP2005228320A (en) Method and apparatus for high-speed visualization of depth image-based three-dimensional graphic data, and program-recorded computer readable recording medium
JPH0749964A (en) Three-dimensional dynamic image generating device
JPH11161819A (en) Image processor, its method and recording medium recording image processing program
US6476819B1 (en) Apparatus and method for assigning shrinkage factor during texture mapping operations
JP3629243B2 (en) Image processing apparatus and method for rendering shading process using distance component in modeling
KR100283071B1 (en) Fast Texture Mapping Method
KR0179354B1 (en) Texture mapping method and image processing apparatus
JP2000348206A (en) Image generating device and method for deciding image priority
JPH10334269A (en) Image processing device and method, and recording medium recording image processing program
JP3979162B2 (en) Image processing apparatus and method
JPS6346584A (en) Method and apparatus for high-speed phong shading
KR100392516B1 (en) real-time rendering method for noninterpolated volume data
JP3747859B2 (en) Image processing apparatus and method
KR100313846B1 (en) Method and device for calculating lod in bilinear mips mapping
JP2000348196A (en) Three-dimensional picture generation device and environment map generation method
JPH05181978A (en) Image display method
JPH09138859A (en) Picture synthesis device
JP2000207576A (en) Method and device for processing image and recording medium recording image processing program
JP3344675B2 (en) Stereoscopic image processing device
JP3311905B2 (en) Image processing device

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20121203

Year of fee payment: 13

FPAY Annual fee payment

Payment date: 20131202

Year of fee payment: 14

LAPS Lapse due to unpaid annual fee