0% found this document useful (0 votes)
70 views10 pages

Lab 10 - 3D Viewing3

The document describes a computer graphics lab assignment on 3D viewing. The objectives are to understand 3D viewing in a 3D scene. Tasks include modeling objects like a house, mountains and trees using primitives, drawing the 3D world space, and creating orthographic and perspective views of the scene from the front, side and top. The tasks also involve marking object locations, drawing vertices of the house, setting up the view volume and camera, and adding mouse/keyboard interaction to view the scene.

Uploaded by

hareem100
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views10 pages

Lab 10 - 3D Viewing3

The document describes a computer graphics lab assignment on 3D viewing. The objectives are to understand 3D viewing in a 3D scene. Tasks include modeling objects like a house, mountains and trees using primitives, drawing the 3D world space, and creating orthographic and perspective views of the scene from the front, side and top. The tasks also involve marking object locations, drawing vertices of the house, setting up the view volume and camera, and adding mouse/keyboard interaction to view the scene.

Uploaded by

hareem100
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Department of Computer Science Lab 10: 3D Viewing

University of Karachi BSCS 514 –Computer Graphics


Course Incharge: Humera Tariq

Objective: To be able to Understand 3D Viewing in a 3D Scene

House
Moon

Blue
Mountains

Christmas/triangular
tree Circular Tree
Ground

Task 1: Fill in the table and write what primitive/ strategy you use to model above objects of
your scene

1|Page
Lab 10: 3D Viewing
BSCS 514 –Computer Graphics
Course Incharge: Humera Tariq

Your Object Primitive/Strategy used

1. Ground

2. House

3. Mountain

4. Circular Tree

5. Christmas Tree

6. Moon

Task 2: Draw 3D world space, Mark Origin Point and four corners of the ground
using code given below:

Origin ? x-axis ? , y axis ?, z axis? Minimum(x,y,z) of floor ? Maximum (x,y,z) of floor ?

2|Page
Lab 10: 3D Viewing
BSCS 514 –Computer Graphics
Course Incharge: Humera Tariq

Task 3: Write the difference between orthographic and perspective view. Then Draw
Orthographic and perspective Front view of given Scene in space provided below:

3|Page
Lab 10: 3D Viewing
BSCS 514 –Computer Graphics
Course Incharge: Humera Tariq

Orthogrphic Front view (Assume you are looking infront of door)

Perspective Front view (Assume you are looking infront of door)

Task 4: Draw Orthographic and perspective Side view of given Scene in space provided below:

Orthogrphic Side view

4|Page
Lab 10: 3D Viewing
BSCS 514 –Computer Graphics
Course Incharge: Humera Tariq

Perspective Side view

Task 4: Mark the Locations (x,y,z) of Objects on the top view given below using code:

5|Page
Lab 10: 3D Viewing
BSCS 514 –Computer Graphics
Course Incharge: Humera Tariq

Code for Task 4

6|Page
Lab 10: 3D Viewing
BSCS 514 –Computer Graphics
Course Incharge: Humera Tariq

} // end drawEverything

Task 5: Mark all the vertices of House using code in Task 4

7|Page
Lab 10: 3D Viewing
BSCS 514 –Computer Graphics
Course Incharge: Humera Tariq

Task 6: Assume you stand in front of House door looking straight through door.

8|Page
Lab 10: 3D Viewing
BSCS 514 –Computer Graphics
Course Incharge: Humera Tariq

Write your suggestions for glOrtho(?,?,?,?,?,?) and gluLookAt(……?.......);

Draw your establisthed View volume in world space to show how much of your scene is
covered by view volume.

Task 7: Start with Skeleton Code and Finalize display routine to create First view of your 3D scene

Perspective Camera if ortho =0 Orthogrphics Camere if ortho =1


void display() Set Multiple viewports and show all
{ views
glClear(GL_COLOR_BUFFER_BIT | if (ortho==1) //
GL_DEPTH_BUFFER_BIT); {

if (ortho==0) //Perspective view }


{
//Place the camera and set target
glutSwapBuffers(); //Double Buffer
//Define Viewing Volume }

//Draw Objects
drawEverything();
drawFloor();}
Target view

9|Page
Lab 10: 3D Viewing
BSCS 514 –Computer Graphics
Course Incharge: Humera Tariq

Task 8: Add Mouse and Keyboard interaction to view your scene

10 | P a g e

You might also like