Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 457 Modeler Help Session Lovingly brought to you by: TA Steve.

Similar presentations

Presentation on theme: "CSE 457 Modeler Help Session Lovingly brought to you by: TA Steve."— Presentation transcript:

1 CSE 457 Modeler Help Session Lovingly brought to you by: TA Steve

2 What I’ll be yappin’ about... Quick review of OpenGL Overview of the application What’s in the code? Building a model Hierarchies: Live and Uncut! Some Warnings A few Hints...

3 OpenGL Review Remember: OpenGL is a STATE MACHINE. –When you enable/disable something— glEnable/Disable()—you are changing state. –I.e... Change it once, and then change it to something different when necessary. How OpenGL draws:

4 Overview of the Application Two windows –Control Slider Window and Model View To control the model view... –Left-click Rotate the camera around the point that it is currently looking at. –Middle-click Move the point that the camera is currently looking at. –Right-click Move the camera closer to the point that it is currently looking at

5 What’s in the Code? modelerapp.* and modelerui.* –Handles most of the user interface stuff (sliders, windows, etc). –Modelerapp.h defines the ModelerApplication class, which is important modelerdraw.* –Primitive shapes (spheres, boxes, cylinders, and triangles) –Changing material attributes

6 What’s in the Code? (cont) modelerview.h defines the ModelerView object –This is the base class of your model. –Handles the OpenGL drawing and event handling. –Look at sample.cpp; notice that BoxModel is a subclass of ModelerView? camera.* –Provides camera functionality. –Modify this file to implement your own version of gluLookAt.

7 What’s in the Code? (cont) Vec/Mat.h –Some nice vector/matrix operations, already written for you! –Even after 3 years, may still have some bugs— email out if you find one. modelerui.fl –Unless you have a great reason, don't touch this. Millions of innocents could suffer!

8 Building a Model Check out sample.cpp (might want to rename this) –This is where your model class is defined. The draw method of this class is where you will build your model. –Look in main() This is where the model controls are defined The global enum at the top of the file defines the name and number of controls.

9 Hierarchies gone Wild! Hierarchies in OpenGL –glPushMatrix –glPopMatrix Transforms: glTranslated glRotated glScaled

10 Hierarchies gone Wild! (cont) How do we build an articulated model using hierarchies and OpenGL? Check out this example...

11 Some Warnings Don’t edit modelerdraw or modelerapp unless you really really have to! –Depending on your changes, editing these files may make your model incompatible with the animator skeleton code. –You should be able to do everything you need within the other files. Remember to keep track of your pushes and pops! –Mapping out your hierarchy on paper may not hurt either.

12 Some miscellaneous hints... gluLookAt –Check out your slides and the OpenGL blue book. –It is important that you understand how this works. How do I create animation...? –Figure out a good way to call draw() repeatedly. Online tutorials can be invaluable. –Use these to help with OpenGL implementation.

Download ppt "CSE 457 Modeler Help Session Lovingly brought to you by: TA Steve."

Similar presentations

Ads by Google