Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prepared by your friendly, phantom TA Jennifer

Similar presentations


Presentation on theme: "Prepared by your friendly, phantom TA Jennifer"— Presentation transcript:

1 Prepared by your friendly, phantom TA Jennifer
Modeler Help Session Prepared by your friendly, phantom TA Jennifer

2 What this presentation covers…
Open GL review/hints The Application – what are we making, and how do we navigate? Who’s Who in the code Constructing a Model Useful Commands Warnings Hints

3 Open GL Open GL is a State Machine
glEnable()/Disable() changes the state This means that once you change something, it will stay that way! (Until you change it to something new) How Open GL draws:

4 Modeler Application Overview
Two main windows – control window with sliders, and model view window To navigate in the model view window: To move the point you’re looking at, middle click & hold while moving focus point To rotate view, left click and move mouse To zoom in/out, right click and move mouse

5 Who’s who? Modelerapp.* and Modelerui.* Modelerdraw.*
Handles most of the user interface Modelerapp.h defines ModelerApplication class – important DO NOT CHANGE Modelerapp.*!!! Modelerdraw.* Handles primitive shapes, changing material attributes Again, DO NOT CHANGE! For the animator project, you will be re-using your model source file and plugging it into a different application. If you change Modelerapp.* or Modelerdraw.*, your model may not work with the animator project!

6 Who’s who continued… Modelerview.h Defines ModelerView object
This is the base class of your model – your model will be a subclass of ModelerView (see sample.cpp BoxModel example) Modelerview handles events and is involved in drawing Once again, better to not change this file

7 Helpful Files Modelerui.fl Vec.h/Mat.h Once again – Hands off!
Helpful files that have vectors and matrices Very useful vector/matrix operations! By this point, the bugs should be gone, but if you find one, let me know

8 What DO I get to change? Camera.* Sample.cpp Controls camera functions
You DO get to change it! – look in camera.cpp to implement your own version of gluLookAt() Sample.cpp Example BoxModel. You will replace this with your own model file – to start, I would suggest copying sample code and then modifying to make sure you include the methods you need.

9 Constructing Your Model
Open Sample.cpp Draw() function is where you will build your model Main() function initializes the controls (this is where you will add slider controls) Enum at top of file defines the names and number of controls (will have to add controls both in main and here)

10 Useful Commands glPushMatrix() glPopMatrix() Transforms:
These keep track of the state of your model in a stack – if you want to make changes and then undo, glPushMatrix() will keep track of where everything was, and when popped off the stack will return to those values If your model is behaving weirdly, check your pushes and pops – having unmatched pushes and pops is common, and can cause a lot of grief! Transforms: glTranslated glRotated glScaled

11 Warnings… Remember: Don’t change modelerapp or modelerdraw unless you really, really have to – and there shouldn’t be a reason you have to If you do think you have a reason to change these files, consult with a TA first – changing them can make your model incompatible with the Animator project! Keep track of your pushes() and pops()!

12 Hints gluLookAt: Look in your slides and in the OpenGl Blue Book (in blue book pay attention to penciled in additions) Make sure you understand how this works! If you’re unsure how to do something, try the OpenGL online tutorials – they can be very helpful for figuring out how to implement things! For making your animation sequence – find a way to call draw repeatedly


Download ppt "Prepared by your friendly, phantom TA Jennifer"

Similar presentations


Ads by Google