1 3D Modelling with OpenGL Brian Farrimond Robina Hetherington.

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

Programming In C++ Spring Semester 2013 Lecture 2 Programming In C++, Lecture 2.
C Programming for engineers Teaching assistant: Ben Sandbank Home page:
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
OLE Container Carlotta Eaton Exploring Microsoft Visual Basic 5.0 To insert your company logo on this slide From the Insert Menu Select “Picture” Locate.
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
Programming The Development Environment and Your First C Program.
Course Introduction and Getting Started with C 1 USF - COP C for Engineers Summer 2008.
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
Using Visual C++ and Pelles C
CMSC 104, Version 9/011 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program 104 C Programming Standards and Indentation.
Creating a Console Application with Visual Studio
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
A First Program Using C#
INTRODUCTION TO C PROGRAMMING LANGUAGE Computer Programming Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
Using Visual Studio 2013 An Integrated Development Environment (IDE)
Gator Engineering 1 Chapter 2 C Fundamentals Copyright © 2008 W. W. Norton & Company. All rights reserved.
CS Tutorial 1 Getting Started with Visual Studio 2012 (Visual Studio 2010 are no longer available on MSDNAA, please choose Visual Studio 2012 which.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
IE 411/511: Visual Programming for Industrial Applications
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Creating your first C++ program
Programming With C.
Engineering Computing I Chapter 1 – Part A A Tutorial Introduction.
Computer Science I How to Configure Visual Studio.NET 2003 for C++ Colin Goble.
CMSC 104, Version 9/011 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program 104 C Programming Standards and Indentation.
1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Using Microsoft Visual Studio C++ Express 2005 Name: Dr Ju Wang Ashwin Belle Course Resource:
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
Algorithms  Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Information and Communication Technology Sayed Mahbub Hasan Amiri Dhaka Residential Model College Higher Secondary.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Chapter 2 part #1 C++ Program Structure
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
DOCUMENTATION SECTION GLOBAL DECLARATION SECTION
1 Getting Started with C++ Part 2 Linux. 2 Getting Started on Linux Now we will look at Linux. See how to copy files between Windows and Linux Compile.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Computer Programming A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return.
 2007 Pearson Education, Inc. All rights reserved. A Simple C Program 1 /* ************************************************* *** Program: hello_world.
1 UMBC CMSC 104, Section Fall 2002 Functions, Part 1 of 3 Topics Top-down Design The Function Concept Using Predefined Functions Programmer-Defined.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
2.1 First C Program. First Program Open visual studio, click new file Save as “programName.c” – Program must start with letter and have no spaces – Must.
Introduction to C Topics Compilation Using the gcc Compiler
Dive Into® Visual Basic 2010 Express
Chapter 2: The Visual Studio .NET Development Environment
Computer Programming Chapter 1: Introduction
Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Introduction to C Topics Compilation Using the gcc Compiler
1. Open Visual Studio 2008.
Introduction to C Topics Compilation Using the gcc Compiler
Lab 1 Introduction to C++.
Programming Fundamentals Lecture #3 Overview of Computer Programming
Double click Microsoft Visual Studio 2010 on the Computer Desktop
Introduction to C Topics Compilation Using the gcc Compiler
Creating a Windows Application Project in Visual Studio
Introduction to C Topics Compilation Using the gcc Compiler
Chapter 2 part #1 C++ Program Structure
Presentation transcript:

1 3D Modelling with OpenGL Brian Farrimond Robina Hetherington

2 Schedule Week 7C programming 2D OpenGL Week 83D OpenGL Animation Interaction Week 9Colour, materials, lighting Using 3DSMax models Week 10Portfolio work

3 Today’s class Programming in C Using.NET Visual C++ Compiling + Linking = Building a program C programming with OpenGL Computer Graphics A first OpenGL program

4 Programming in C The “Hello world” program /* hello.cpp */ #include int main() { printf(“hello, world\n”); return 0; }

5 Programming in C The “Hello world” program /* hello.cpp */ #include int main() { printf(“hello, world\n”); return 0; } /* and */ enclose comments which are ignored by the compiler

6 Programming in C The “Hello world” program /* hello.cpp */ #include int main() { printf(“hello, world\n”); return 0; } Include information about the standard library

7 Programming in C The “Hello world” program /* hello.cpp */ #include int main() { printf(“hello, world\n”); return 0; } A C function. Its name is main A C program consists of a collection of functions

8 Programming in C The “Hello world” program /* hello.cpp */ #include int main() { printf(“hello, world\n”); return 0; } A C function consists of: a header line a body made up of statements enclosed by { and }

9 Programming in C The “Hello world” program /* hello.cpp */ #include int main() { printf(“hello, world\n”); return 0; } header line body made up of statements

10 Programming in C The “Hello world” program /* hello.cpp */ #include int main() { printf(“hello, world\n”); return 0; } This is where the program actually starts.

11 Programming in C The “Hello world” program /* hello.cpp */ #include int main() { printf(“hello, world\n”); return 0; } Every C program has a main function

12 Programming in C The “Hello world” program /* hello.cpp */ #include int main() { printf(“hello, world\n”); return 0; } printf is a library function to print characters

13 Programming in C The “Hello world” program /* hello.cpp */ #include int main() { printf(“hello, world\n”); return 0; } Return from the main function – i.e. end the program

14.NET Visual C++ Microsoft’s C programming environment Program code is placed inside a.NET project.NET builds the program (or application) with this project We shall build a console application (as opposed to a Windows application)

15 Using.NET Copy the folder dotNetExamples\hello from the CD to your disc space Launch.NET Open the hello project using File | Open and navigate to hello.sln inside the hello folder

16 Exploring the hello project Solution tree

17 Exploring the hello project Solution tree Double click on hello.cpp to see the program code

18 Hello.cpp

19 Building the program To build the program, select the menu item Build | Build Solution Or use one of these two buttons

20 Running the program To run the program, select menu item Debug | Start Or use this button

21 Use of getchar() Without getchar() the program terminates at once before we can see what printf has done getchar() pauses the program until we press the return key.

22 Exercises Modify the text inside the printf statement Modify the program so that it prints out One Two Three

23 Building = Compiling + linking Building is a two stage process: –Compiling source code into object code –Linking object code and library code to produce the program (known as the executable)

24 More on Building See using dotNET IDE in C page 16

25 Separate compilation Large programs are made up of many source files Each file compiled separately Advantages: –Changing the code of one file does not require recompiling the entire program –Team of programmers can work on different files

26 Multifile example

27 The multifile.NET project Copy the folder dotNetExamples\multifile from the CD to your disc space Open the project using File | Open Examine the solution tree

28 The multifile.NET project Build and run the program Edit func2.cpp so that it prints out: This is the new func 2 Rebuild and rerun the program