Đã hoàn thành

Shading in Computer Interactive Graphics

Interactive system for shading of a 3D object.

- Manipulate Normal Vectors

- Create Light sources

- Difference between flat shading and Gouraud shading

1. Assign normal vectors:

In OpenGL, you need to specify a normal vector to each vertex of a face (polygon). For example, the following statements indicate that the vertex (1,1,1) is assigned with a normal vector (1,0,0).

glNormal3f(1, 0, 0);

glVertex3f(1, 1, 1);

2. Create light sources:

In OpenGL, you can create a light source with a specific property, such as position, color and direction by a function called glLightfv() or glLightf(), as follows:

void glLightfv(GLenum light, GLenum pname, const TYPE *param);

void glLightf(GLenum light, GLenum pname, TYPE param);

glLightfv() has three function parameters. The first one indicates the identity of a light source, which can be one of the values from GL LIGHT0 to GL LIGHT7. The second one indicates the name of a property, which can be one of the following values

- GL POSITION

- GL AMBIENT, GL DIFFUSE, GL SPECULAR

- GL SPOT DIRECTION

3. Shading:

Three shading models: flat, Gouraud, and phong. With the flat model, the

colors of points in the same face are identical. So, it is common that the flat model is not good at retaining 3D strucutre of an object. With the Gouraud model, the colors of points in a face are interpolated by the colors of the vertex of the face. Recall that the colors of different vertices of a face are usually different even if they are assigned with the same normal vector. Therefore, the colors of points in a face are different.

OpenGL provides implementation of the flat and Gouraud shading. In OpenGL, you can specify a shading model by the following function:

void glShadeModel(GLenum mode);

where mode can be GL FLAT or GL SMOOTH. GL SMOOTH implies the Gouraud shading model.

4. User interaction:

The system allows a use to use a popup menu to select a shading model, i.e., the flat shading or Gouraud shading model.

The system allows a user to use the keyboard to change the position of a selected light source. The user can use the key 0 and 1 to select a light source. Furthermore, the user can use the following 2 keys to change the position of the selected light source.

- j – move the light source to its left

- l – move the light source to its right. Implement one more keyboard interaction as follow:

- r – rotate counter clockwise 10 degrees horizontally, i.e., around the vertical line passing through the center of the object. You can use the glRotate() function. But keep in mind that you also need two translation transformation, in addition to glRotate().

5. Input data:

The input data is stored in a file named something.obj. A data object file may contain three symbols: #, v and f. # indicates a comment line. In general, Comments are optional, i.e., a data file may not have any comment lines. To simplify the I/O access in this project, you can assume that the first two lines in a data file are comments that have the information of the number of vertices and the number of polygons. The symbol v indicates a vertex of x, y and z coordindates. The symbol f indicates a face (polygon) consisting of a set of vertices. The following is an example of the data file for a house object.

Example:

# 10 vertices

# 7 polygons

v 0 0 54

v 16 0 54

v 16 10 54

v 8 16 54

v 0 10 54

v 0 0 30

v 16 0 30

v 16 10 30

v 8 16 30

v 0 10 30

f 1 2 3 4 5

f 2 7 8 3

f 7 6 10 9 8

f 6 1 5 10

f 2 1 6 7

f 3 8 9 4

f 10 5 4 9

For this house object, the first vertex has the coordinates (0, 0, 54). The first face has 5 vertices, i.e., 1st, 2nd, . . ., 5-th vertices. To further simplify the I/O access in this project, you can assume that each face is a triangle. Thus, each face consists exact three vertices.

NOTE: source code and readme required

************* Complete Description in ATTACHMENT**************

Kĩ năng: Lập trình C, OpenGL

Xem nhiều hơn: graphics design computer systems, 28th annual conference computer graphics interactive techniques, computer hour counter freelance, computer hour counter log, outsourcing computer graphics work, present status computer graphics design animation bangladeshi market, computer graphics projects opengl, computer time counter, computer graphics want ads ohio, computer graphics artificial intelligence, company looking hiring animators computer graphics, computer aided graphic designing wijeya graphics pvt ltd, computer graphics contract work, computer graphics logos, best institutes rawalpindi computer designing graphics, counter timer computer working, search illustrator computer graphics hanoi, computer graphics porfolio, computer graphics modeling

Về Bên Thuê:
( 4 nhận xét ) Naperville, United States

ID dự án: #13787133

Được trao cho:

sujanttt

Hello sir, lets do this project. I am ready to do it. I guess you are okay with the milestone that I have bid here. I will finally start working now.

$25 USD trong 1 ngày
(17 Đánh Giá)
4.0

8 freelancer đang chào giá trung bình $83 cho công việc này

freelancerLatino

Hello.... I can do a genuine version for you ... I love opengl, and I should be a good option for this project. 2 days or less ... Best regards!

$60 USD trong 2 ngày
(88 Nhận xét)
6.9
hbxfnzwpf

I am very proficient in c and c++ and opengl. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on client side, so I am very good Thêm

$200 USD trong 3 ngày
(85 Nhận xét)
6.6
renardpaul

Hello, expert in OpenGL and C++ programming here. I can implement for you a program to illustrate various shading techniques of a 3D objects as per the attached description. The code will be well commented and I Thêm

$200 USD trong 5 ngày
(63 Nhận xét)
6.0
xzan88

Hi, I have done many projects in C/C++ and OpenGL. I have read the requirements. I can finish it in a couple of days. Please contact me.

$70 USD trong 2 ngày
(61 Nhận xét)
5.7
smittynpro

Hello, how are you? I can help you! I can deliver the program exactly as you request today :-) I am totally free. Also, I made assignments/project as this in the past several times. Now, let introduce myself: I am a c Thêm

$30 USD trong 1 ngày
(24 Nhận xét)
4.8
franjav

Hi. I'm an expert of computer graphics and I can do this work in no time. I have done shading for lighting a lot of times.

$55 USD trong 2 ngày
(7 Nhận xét)
4.1
megasoft3

Dear Client, Thanks for providing us opportunity to place bid over the project and communicate with [url removed, login to view] mainly deal in web development, SEO, Android App, software testing and graphic design. Our vision is to b Thêm

$26 USD trong 7 ngày
(0 Nhận xét)
0.0