CMSC 427 Computer Graphics Programming Assignment 1: Introduction to OpenGL and C++ Due Date: 11:59 PM, Sept. 15, 2015



Similar documents
Android: Setup Hello, World: Android Edition. due by noon ET on Wed 2/22. Ingredients.

Outlook 2011 Setup For ITS Exchange 2010 Server Using A SOM Domain Login

Silverlight for Windows Embedded Graphics and Rendering Pipeline 1

Code::Blocks Student Manual

This installation guide will help you install your chosen IceTheme Template with the Cloner Installer package.

Lab 1 Beginning C Program

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

IBI Group FTP: Usage Instructions

Bulk Upload Tool (Beta) - Quick Start Guide 1. Facebook Ads. Bulk Upload Quick Start Guide

DEPLOYING A VISUAL BASIC.NET APPLICATION

INSTALLATION GUIDE ENTERPRISE DYNAMICS 9.0

How to get MOSS 2007 dev. environment set up in Vista with sample project.

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Information Server Documentation SIMATIC. Information Server V8.0 Update 1 Information Server Documentation. Introduction 1. Web application basics 2

1/5/2013. Technology in Action

GETTING STARTED WITH SQL SERVER

TEGRA X1 DEVELOPER TOOLS SEBASTIEN DOMINE, SR. DIRECTOR SW ENGINEERING

WINDOWS 7 & HOMEGROUP

CAS CLOUD WEB USER GUIDE. UAB College of Arts and Science Cloud Storage Service

GFI Cloud User Guide A guide to administer GFI Cloud and its services

Visualizing Data: Scalable Interactivity

the barricademx end user interface documentation for barricademx users

ThinPoint Quick Start Guide

Hypercosm. Studio.

Testing your Linux Virtual Box

Maintaining, Updating, and Protecting Windows 7

CONNECTING TO DEPARTMENT OF COMPUTER SCIENCE SERVERS BOTH FROM ON AND OFF CAMPUS USING TUNNELING, PuTTY, AND VNC Client Utilities

SWAN 15.1 Advance user information What s new in SWAN? Introduction of the new user interface. Last update: 28th April 2015

Global Knowledge European Remote Labs Accessing the Remote Labs portal from Windows

You can learn more about Stick around by visiting stickaround.info and by finding Stick Around on social media.

Getting Started with CodeXL

Tutorial 2 Online and offline Ship Visualization tool Table of Contents

CREATING YOUR OWN PROFESSIONAL WEBSITE

Driver Updater Manual

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Using GitHub for Rally Apps (Mac Version)

How To Use Exhange On Outlook On A Pc Or Macintosh Outlook 2007 On Your Pc Or Ipad (For Windows Xp) On Your Ipad Or Ipa (For Your Windows Xp). (For A Macintosh) On A

How To Test Your Web Site On Wapt On A Pc Or Mac Or Mac (Or Mac) On A Mac Or Ipad Or Ipa (Or Ipa) On Pc Or Ipam (Or Pc Or Pc) On An Ip

Geomagic Design. Release Notes. Get to Market Faster with Better Products at a Lower Cost V17

Quick Start Guide for VMware and Windows 7

Andreas Burghart 6 October 2014 v1.0

What Do I Need To Create a Visualization For ScreenPlay?

SOLAROX RGB-Master Pro LAN. RGB-Master Pro LAN. Network-compatible RGBW Controller -

Content Management System

Windows Intune Walkthrough: Windows Phone 8 Management

aspwebcalendar FREE / Quick Start Guide 1

VeloView Offline GUI

Step 1 Registering and Installing VMWare Fusion on a Macintosh

Lab 0 (Setting up your Development Environment) Week 1

Tutorial on Basic Android Setup

Getting credit for completing this lab

Image Processing and Computer Graphics. Rendering Pipeline. Matthias Teschner. Computer Science Department University of Freiburg

Installation Manual Version 8.5 (w/sql Server 2005)

Quick Start Guide for Parallels Virtuozzo

Outbreak questionnaires and data entry using the new EpiData modules

ACTIVE DIRECTORY DEPLOYMENT

Mac - Juniper Remote Desktop Instructions

Managing Online and Offline Archives in Outlook

Homework 9 Android App for Weather Forecast

Department of Information Technology. Microsoft Outlook Outlook 101 Basic Functions

Introduction to Programming Tools. Anjana & Shankar September,2010

PEPPER PACK USER GUIDE

Creating Home Directories for Windows and Macintosh Computers

Honeywell Internet Connection Module

FACULTY GETTING STARTED WITH i>clicker2

Lab: Application Lifecycle Management (ALM) Across Heterogeneous Platforms (Java/.NET)

StrikeRisk v6.0 IEC/EN Risk Management Software Getting Started

Installing OpenVSP on Windows 7

Online Backup Client User Manual

SSL VPN Setup for Windows

MaineCare Medicaid EHR Incentive Program Meaningful Use Wizard Guide Last Update: February 10, 2014

Local Caching Servers (LCS) February 2015

OneDrive for Business User Guide

Anchor End-User Guide

Table of Contents. Vu ipad. v2.6. Navigation. Document Manager. Sync Manager. File Access. Field Verification Measurements. Markups List.

Installation and Setup: Setup Wizard Account Information

CMPT 354 Database Systems. Simon Fraser University Summer Instructor: Oliver Schulte

ADT Plugin for Eclipse

Compiler Setup and DirectX/OpenGL Setup

Version Control with Subversion

USER GUIDE CLOUDME FOR WD SENTINEL

ANDROID DEVELOPER TOOLS TRAINING GTC Sébastien Dominé, NVIDIA

Document Manager 2.0. User Guide

Before you begin 2 Initial laptop setup 2 Configure Microsoft update 3 Install University of Kent programs 3

CSEE 4119: Computer Networks, Spring 2014

Online Web Learning University of Massachusetts at Amherst

OPERATING SYSTEMS Software in the Background. Chapter 2

Setup Guide for HDP Developer: Storm. Revision 1 Hortonworks University

1) SETUP ANDROID STUDIO

Dreamweaver and Fireworks MX Integration Brian Hogan

AgilityRocks! software for agility trial scoring - setup

SourceAnywhere Service Configurator can be launched from Start -> All Programs -> Dynamsoft SourceAnywhere Server.

Practical Example: Building Reports for Bugzilla

Publisher 2010 Cheat Sheet

Lab 2 - CMPS 1043, Computer Science I Introduction to File Input/Output (I/O) Projects and Solutions (C++)

Table of Content RELEASE INFORMATION... 2 ORDERING AND INSTALLATION... 3 CHANGES IN CUTTING POWERPAC

Learning Activity Management System TEACHER S GUIDE. October 2006 LAMS V2.0 for The First International LAMS Conference 2006

CSE 564: Visualization. GPU Programming (First Steps) GPU Generations. Klaus Mueller. Computer Science Department Stony Brook University

Transcription:

CMSC 427 Computer Graphics Programming Assignment 1: Introduction to OpenGL and C++ Due Date: 11:59 PM, Sept. 15, 2015 Project Submission: 1) Delete all intermediate files (run the command make clean) and the Makefile created during the compilation process. Also delete the executable file. 2) Place all files for the project in a folder and ZIP up the folder. You will submit your project via the submit server. To submit a zip file, login to the submit server webpage and look for the link to make a web submission. Project Description The purpose of this assignment is to walk you through the setup/installation process of the various programs you ll need for this course. In addition, you will modify two small OpenGL projects in order to get acquainted with working in both OpenGL and C++. The starter code for these two projects can be downloaded from the submit server. The code in these projects will serve as a template for most of the projects in this course, so it is important that you read and understand what is happening. As always feel free to ask questions in class, in office hours, or on piazza. Installation and Setup The first thing to do is figure out what version of OpenGL is currently running on your computer. This class will require OpenGL version 4.X. Because this is a computer graphics course, we cannot support graphics cards running older versions of OpenGL. If your computer does not have the necessary hardware, you will need to use one of the Mac labs on campus to work on assignments. All coding assignments for this course are required to run on one of the Mac lab computers. The quickest way to check what version of OpenGL you have is to download the OpenGL Extension Viewer. This is only available for Mac and Windows. Download Link - http://www.realtech-vr.com/glview/ Run it and you should see something similar to the following screenshot

If you have Linux, you can check your graphics card information from the command line. glxinfo grep i "opengl For Linux users, you may have to look up the specific graphic card on your computer and search online for the corresponding hardware specifications. The vendor documentation should tell you what version of OpenGL is supported by the card. Note: If your graphics card doesn t support opengl 4.X outright, try updating your device drivers for the card before giving up. In this case you should visit the vendor s website for more information on how to update your drivers. For Mac and Linux users, you will need to install gcc, a C++ compiler, if you don t already have it. Be sure to update to the latest version. For Windows users, you will need to install Visual Studio. Visual Studio can be obtained through Microsoft DreamSpark for free with your school email address. This class will use a collection of libraries known as Qt. Visit the Qt website (link below) and download the offline installer for your appropriate operating system. Note the installer will try to get you to sign up for an online account. Skip this step. For this course, we will be using Qt v5.5.0. Download Link - https://www.qt.io/download-open-source/#section-3 This will automatically install an application called QtCreator, an IDE similar to Eclipse. You may choose to work on projects inside QtCreator or from the command line (which is simpler for several reasons). We will use the Qt framework quite extensively so you are expected to use the online documentation when you have questions. You should bookmark the documentation now. Documentation - http://doc.qt.io/qt-5/classes.html HelloWorld2D Questions Download a copy of the starter code called CMSC427_HelloWorld2D. It will contain the following files: cmsc427.hpp cmsc427.cpp cmsc427.pro cmsc427.ui GLview.hpp GLview.cpp reachup.png resources.qrc simple.fsh simple.vsh If you have the correct version of OpenGL and everything installed correctly, you should be able to compile and execute the code. From the command line go to the CMSC427_HelloWorld2D folder and execute the following two commands: Mac & Linux > qmake > make Windows > qmake > nmake

The qmake program reads the cmsc427.pro file and other configuration files and will automatically generate a Makefile for the project. Running make (nmake) then executes commands found in the Makefile, calling gcc (Visual Studio) and compiling the C++ source code into an executable file called cmsc427. Finally to run your program, execute the command >./cmsc427 Note: the following questions will require you to browse the online documentation. 1) What file contains the main() function, the starting point for the entire application? 2) What classes are inherited by the class CMSC427Win? What classes are inherited by the class GLview? 3) In the function CMSC427Win::keyPressEvent(), certain functions in the glwidget object are called based on what keys are pressed. What is the class type of glwidget? In what class is glwidget initialized? 4) How often is GLview::timerEvent() called while the application is running? 5) How often is GLview::initializeGL() called while the application is running? 6) How often is GLview::paintGL() called while the application is running? 7) In GLview::paintGL(), there is a float variable called g_objscale that is passed to the shader program (called m_shader in the code). We will go into more detail about what a shader program is later in this course. This variable is responsible for defining how far to stretch the rectangle along the x axis. Based on the previous questions, how often is the value of g_objscale changed? What equation is used to update g_objscale? 8) The file simple.fsh defines a fragment shader program. A fragment shader is compiled and run on your graphics card independent from the rest of the C++ code running on the CPU. Currently the fragment shader interpolates between the squirrel picture (denoted as texcolor1 in the code) and the color spectrum background. Modify the fragment shader code so that the squirrel picture remains visible at all times. (Hint: only one line of code needs to be changed). 2DTriangle Questions Download a copy of the starter code called CMSC427_minimalGL_2D_twoTriangles. It will contain the following files: cmsc427.hpp cmsc427.cpp cmsc427.pro cmsc427.ui GLview.hpp GLview.cpp resources.qrc simple.fsh simple.vsh To compile and execute the code from the command line, follow the same directions outlined in the HelloWorld2D example. For some questions, you will be asked to modify code. 9) In the function GLview::initializeGL(), there is an array sqverts defined as float sqverts[12] = { -.5, -.5, // xy coordinates of the first vertex.5,.5, // xy coordinates of the second vertex.5, -.5, // xy coordinates of the third vertex

This defines the (x,y) coordinates for each vertex of the triangle. Through trial and error, modify the x coordinate of each vertex until each point of the triangle lies on the left/right border of the application window. What are the new (x,y) coordinates of each vertex of the triangle? 10) In the function GLview::initializeGL(), there is an array sqcol defined as float sqcol[18] = { 1, 0, 0, // RGB value of the first vertex 0, 1, 0, // RGB value of the second vertex 0, 0, 1, // RGB value of the third vertex This defines the color at each vertex of the triangle. The amount of red, green, and blue (RGB) that will be at each vertex is specified in the real-value range of [0,1]. Now modify the code so that float sqcol[18] = { 1, 0, 0, // RGB value of the first vertex 0.8, 0.2, 0.9, // RGB value of the second vertex 0, 0, 1, // RGB value of the third vertex In your own words, explain how this affects the triangle that is drawn. Include a screenshot before the code change and a screenshot after the code change. 11) The file simple.vsh defines a vertex shader program. A vertex shader program is executed and run on your graphics card independent from the rest of the C++ code running on the CPU. In simple.vsh, change the following line of code gl_position = vec4(avertex.x * uvertexscale, avertex.y * uvertexscale, 0, 1); to gl_position = vec4(avertex.x, avertex.y * uvertexscale, 0, 1); In your own words, explain what visual difference this makes to the drawn triangle. 12) While running the application, press the number 2. Two triangles will be drawn. This is done by the function GLview::moreTriangles(). Modify GLview::moreTriangles() so that four triangles are drawn when the number 2 is pressed. Take a screenshot before the code change (with one triangle) and a screenshot after the code change (with four triangles). The triangles must not overlap each other and they can be any color(s) of your choice except all black (they will not be visible in this case). Bonus Opportunity 5% extra credit Modify the code in CMSC427_minimalGL_2D_twoTriangles so that a near-perfect multi-colored circle is drawn using triangles. Hint: near-perfect implies that enough triangles are used to draw the circle such that it looks like a perfect circle. Technically, it will still not be a circle. Screenshots of your creation are required for bonus credit. Code Requirements Your program must be executable from the command line using qmake and make. For further instructions on how to do this, review the instructions on compiling and executing the HelloWorld2D example. Grading Your program will be graded based upon successful calls to it from the command line and a correct implementation. All code that you write should be well commented. Your code is judged subjectively based on the simplicity and clarity of implementation. An implementation that is easy to understand, but

has few minor bugs will be scored higher than a messy implementation with the same number of minor bugs.