Cheating: In case of cheating, all parts involved (source(s) and receiver(s)) get zero.

Similar documents
// double buffering and RGB glutinitdisplaymode(glut_double GLUT_RGBA); // your own initializations

Introduction to OpenGL

Computer Graphics. Transformations. CSC 470 Computer Graphics 1

Graphics Pipeline & APIs

Graphics Pipeline & APIs

API for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3

Books, OpenGL, GLUT, GLUI, CUDA, OpenCL, OpenCV, PointClouds, and G3D

20 GLuint objects; 36 Scale += 0.1; 37 break; 38 case GLUT_KEY_DOWN:

Books, OpenGL, GLUT, CUDA, OpenCL, OpenCV, PointClouds, G3D, and Qt

Outline. Other Graphics Technology. OpenGL Background and History. Platform Specifics. The Drawing Process

Graphics and Computation Introduction to OpenGL

1 /* 4 C:\opencv\build\include. 6 C:\opencv\build\x86\vc10\lib

Lecture 5: Viewing. CSE Computer Graphics (Fall 2010)

Spring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013

Computer graphics MN1

CSE 167: Lecture #8: Lighting. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Introduction to OpenGL

CS4202: Test. 1. Write the letter corresponding to the library name next to the statement or statements that describe library.

Lecture 4 Advanced Computer Graphics (CS & SE )

Methodology for Lecture. Importance of Lighting. Outline. Shading Models. Brief primer on Color. Foundations of Computer Graphics (Spring 2010)

Using GLU/GLUT Objects

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou

DONALD HOUSE: CPSC 8170, FALL 2018 DESIGN OF A REAL-TIME ANIMATION PROGRAM

GL_MODELVIEW transformation

Introduction to OpenGL

Due: Thursday, February 6 th, 11:59 pm TA: Mason Remy

Describe the Orthographic and Perspective projections. How do we combine together transform matrices?

Hierarchical Modeling: Tree of Transformations, Display Lists and Functions, Matrix and Attribute Stacks,

OpenGL Tutorial. Ceng 477 Introduction to Computer Graphics

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

Lighting. Chapter 5. Chapter Objectives. After reading this chapter, you'll be able to do the following:

Computer Graphics. Illumination and Shading

Computer graphics MN1

compatibility mode core mode

Understand how real-world lighting conditions are approximated by OpenGL

RECITATION - 1. Ceng477 Fall

Rendering Pipeline/ OpenGL

OpenGL and X, Column 1: An OpenGL Toolkit

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

Computer graphics Labs: OpenGL (1/3) Geometric transformations and projections

OPENGL TM AND X, COLUMN 1: AN OPENGL TOOLKIT

Precept 2 Aleksey Boyko February 18, 2011

Modeling Objects. Modeling. Symbol-Instance Table. Instance Transformation. Each appearance of the object in the model is an instance

Visualizing Molecular Dynamics

Programming with OpenGL Part 3: Three Dimensions

Computer graphics MN1

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

Due: Thursday, April 28 th by the stroke of midnight! TA: Jeff Booth

CCSI 3161 Project Flight Simulator

Modeling with Transformations

OpenGL: Setup 3D World

5.2 Shading in OpenGL

Lecture 2 2D transformations Introduction to OpenGL

Scientific Visualization Basics

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

Shading in OpenGL. Outline. Defining and Maintaining Normals. Normalization. Enabling Lighting and Lights. Outline

CSC 470 Computer Graphics

The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes

OpenGL. Toolkits.

Outline. Introduction Surface of Revolution Hierarchical Modeling Blinn-Phong Shader Custom Shader(s)

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

Computer Graphics Hands-on

蔡侑庭 (Yu-Ting Tsai) National Chiao Tung University, Taiwan. Prof. Wen-Chieh Lin s CG Slides OpenGL 2.1 Specification

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

Computer graphic -- Programming with OpenGL 2

Modeling Transform. Chapter 4 Geometric Transformations. Overview. Instancing. Specify transformation for objects 李同益

CS418 OpenGL & GLUT Programming Tutorial (IV) MP2 Bonus/Object Picking. Presented by : Wei-Wen Feng 2/20/2008

SE313: Computer Graphics and Visual Programming. Computer Graphics Notes Gazihan Alankus, Fall 2011

Pearce Outline. OpenGL Background and History. Other Graphics Technology. Platform Specifics. The Drawing Process

Hierarchical Modeling. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

1 (Practice 1) Introduction to OpenGL

3D Graphics and API with OpenGL

Hidden Surface Removal. 3D Graphics with OpenGL. Back-Face Culling

Introduction to 3D Graphics with OpenGL. Z-Buffer Hidden Surface Removal. Binghamton University. EngiNet. Thomas J. Watson

Reading on the Accumulation Buffer: Motion Blur, Anti-Aliasing, and Depth of Field

CS418 OpenGL & GLUT Programming Tutorial (I) Presented by : Wei-Wen Feng 1/30/2008

Reading. Hierarchical Modeling. Symbols and instances. Required: Angel, sections , 9.8. Optional:

An Interactive Introduction to OpenGL Programming

Programming using OpenGL: A first Introduction

Two possible ways to specify transformations. Each part of the object is transformed independently relative to the origin

Display Issues Week 5

Hierarchical Modeling and scene graphs

Computer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

CS380: Computer Graphics 2D Imaging and Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:

Cameras (and eye) Ideal Pinhole. Real Pinhole. Real + lens. Depth of field

Programming Graphic Processing Units with CUDA. Paolo Burgio

Hierarchical Modeling and Scene Graphs

Computer Graphics Course 2005

Illumination and Reflection in OpenGL CS 460/560. Computer Graphics. Shadows. Photo-Realism: Ray Tracing. Binghamton University.

Comp 410/510 Computer Graphics Spring Programming with OpenGL Part 4: Three Dimensions

Lectures Transparency Case Study

Transforms 1 Christian Miller CS Fall 2011

Shading and Illumination

Graphical Objects and Scene Graphs

CS380: Computer Graphics Viewing Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:

Illumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface.

Computer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

OpenGL. 1 OpenGL OpenGL 1.2 3D. (euske) 1. Client-Server Model OpenGL

GRAFIKA KOMPUTER. ~ M. Ali Fauzi

Chapter 3: Modeling Transformation

Transcription:

REGULATIONS Due date: 19.11.2009 Thursday 23:59 Late Submission: Late submission is not allowed. Submission: Use the COW system to submit your homework file. The homework should be done and submitted individually. You will submit a single tar.gz file named hw1.tar.gz, which includes your source code for the assignment and a makefile. You will also submit a hardcopy assignment report to the assistants at a defined time and place which will be announced in the newsgroup. Make sure that your code can be compiled by a single make command at the shell prompt. The makefile should produce an executable named hw1 which can be executed directly by typing./hw1 at the command line. Evaluation: Your homework will be evaluated in a Linux environment. Before submission, you have to test your homework at one of the department s computers using Linux to have a common platform. Cheating: In case of cheating, all parts involved (source(s) and receiver(s)) get zero. Newsgroup: You must follow the newsgroup for discussions and possible updates on a daily basis. MAIN THEME - TIME FOR HYPNOSIS In your first assignment, you are going to implement a pendulum by just using two types of objects, cylinders and spheres. Your implementation should be able to animate two types of motions in pendulum, one ball motion and all balls motion. The purpose of this assignment is to make you understand the geometric transformations and introduce you to the computer animation basics.

SPECIFICATIONS In this assignment, you are going to implement a 3D pendulum which is capable of performing two motions. Since you are going to implement a 3D object, you have to adjust your camera and light in order to be able to see nice looking objects. The camera positions and lighting are not in the scope of this assignment. For that reason, you can initialize OpenGL with the below code. You can make changes on this initialization code if you think that it is necessary. The details of these initialization statements will be defined at the recitation. This initialization code may be put in a function that is called once before OpenGL enters the rendering loop. glenable(gl_depth_test); glenable(gl_color_material); glenable(gl_normalize); glshademodel(gl_smooth); // SET LIGHTING glenable(gl_lighting); glenable(gl_light0); GLfloat position[] = {1000.0, 1000.0, 1000.0, 0.0}; GLfloat blackcolor[] = {0.0, 0.0, 0.0, 1.0}; GLfloat whitecolor[] = {1.0, 1.0, 1.0, 1.0}; gllightfv(gl_light0, GL_POSITION, position); gllightfv(gl_light0, GL_AMBIENT, blackcolor); gllightfv(gl_light0, GL_DIFFUSE, whitecolor); gllightfv(gl_light0, GL_SPECULAR, whitecolor); // SET CAMERA glmatrixmode(gl_projection); glloadidentity(); gluperspective(90, 1, 1, 1000000); glmatrixmode(gl_modelview); glloadidentity(); glulookat(2000,2000,-2000,0,0,0,(-2)/sqrt(3), sqrt(2)-(2/sqrt(3)),2/sqrt(3)); Don t forget to define depth buffer while defining the glutinitdisplaymode. This is required since you are performing depth test for your 3D objects. Also remember to clear the GL_DEPTH_BUFFER_BIT at the beginning of your display callback. You must use the timer callback of GLUT in order to have a smooth motion. 25 milliseconds is an acceptable value for the frequency of the callbacks to the timer callback function.

You are just allowed to use the two functions below for creating the components of your pendulum. No other objects can be drawn with either GLU functions or by defining other geometry in OpenGL. You can call the below functions as much as you want in your implementation. If you draw some objects without calling these functions, your assignment will be penalized %50. // Gives the unit sphere void drawsphere(void) { GLUquadric *quadric = glunewquadric(); glusphere(quadric, 20, 100, 100); } // Gives the unit cylinder void drawcylinder(void) { GLUquadric *quadric = glunewquadric(); glucylinder(quadric, 10, 10, 40, 100, 100); } Your pendulum should look like the pendulum image given in the first page. You are free to adopt a different design if you want as long as it satisfies the following conditions: o Each pendulum ball should be connected to holder with at least two ropes formed by cylinders. o Each pendulum ball should be a sphere. o The pendulum holder should be designed by considering the physics rules. It should be formed such that the pendulum can be put on top of a table. FUNCTIONALITY There will be three motion modes in your implementation. Still Mode: In this mode, there will be no animation. The pendulum will be shown without any motions. When your program is started, this is the mode that you have to render. At any time, pressing the key 1 will make the current motion mode still mode. One ball motion: In this mode, you will animate the turn based motion of the balls on the left most and right most sides of the pendulum. These two balls will move in turns going up and down. In real life, this motion can be created by lifting one ball and then releasing it. This motion will go on forever until the motion mode is changed. At any time, pressing the key 2 will make the current motion one ball motion. One ball motion is illustrated in Figure 1. All balls motion: In this mode, you will animate the motion of all balls left and right at the same frequency. In real life, this motion can be created by lifting all the balls on one side and releasing. This motion will go on forever until the motion mode is changed. At

any time, pressing the key 3 will make the current motion all balls motion. All balls motion is illustrated in Figure 2. 1 2 3 4 Figure 1 : One Ball Motion Illustration 1 2 3 4 Figure 2 : All Balls Motion Illustration REPORT QUESTIONS After implementing the assignment according to the above specifications, you will answer the questions in the next pages and hand the hardcopies of the next two pages.

Name, Surname Student ID Number Section CENG477 INTRODUCTION TO COMPUTER GRAPHICS ASSIGNMENT 1 REPORT The questions should be answered in a clear hand-writing format. Computer print-outs will not be accepted. Please don t put the hardcopies into a plastic folder. Use a staple if you have more than one page. Please try to fit your answers in the areas provided below. You can use other sheets if it doesn t fit. Make sure that you write your number also on that extra sheet and give references to that sheet in the related question. 1. What is the transformation matrix that you apply on the ball in the middle during the motion performed on all balls motion? Clearly show how you derive that transformation matrix. 2. What is the purpose of using glpushmatrix( ) and glpopmatrix( ) functions in your implementation? Why do you think these two functions are named with the term matrix?

Student ID Number 3. Why do you think you have to apply the transformations at the reverse order? In other words, why do you write the transformations which should be applied primarily after you write the transformations that should be applied later on? 4. Find the place you call the drawsphere( ) function. Change the order of the gltranslate and glscale you use for this sphere. What is the result? What happens as a result of this change? Why do you think this change of order produced that result? 5. Find a place that you use glrotate with gltranslate. Change the order of these transformations. What is the result? What happens as a result of this change? Why do you think this change of order produced that result?