Project 3 - PowerPoint PPT Presentation

About This Presentation
Title:

Project 3

Description:

... loop to draw the ... To draw the fence, you should first set the modelview matrix so ... on drawFenceSegment() repeatedly to draw the segments around the ... – PowerPoint PPT presentation

Number of Views:14
Avg rating:3.0/5.0
Slides: 17
Provided by: peopl93
Learn more at: https://people.hsc.edu
Category:
Tags: draw | how | people | project | to

less

Transcript and Presenter's Notes

Title: Project 3


1
Project 3
  • Landscape
  • Mon, Oct 6, 2003
  • Due Wed, Oct 15, 2003

2
Landscape
  • Read the handout.
  • Download the files.
  • Landscape.cpp.
  • point3.h.
  • Run Landscape.exe.

3
Landscape
  • Your job is to write the functions that draw the
    trees and the fence.
  • drawTrees()
  • drawOneTree()
  • drawFence()
  • drawFenceSegment()

4
The drawTrees() Function
  • The drawTrees() function should set the modelview
    matrix for each individual tree and then call on
    drawOneTree() to draw the tree.

5
The drawOneTree() Function
  • The drawOneTree() function will draw a tree at
    the current location, as determined by the
    modelview matrix.
  • A tree consists of a trunk and a crown of leaves.
  • That is, a cylinder and a sphere, each properly
    positioned and colored.
  • You may add fall colors if you wish.

6
The drawOneTree() Function
  • The functions drawSphere() and drawCylinder() are
    provided.
  • You must first set the modelview matrix before
    drawing the trunk or the leaves.
  • Otherwise, you will get this
  • BadTree.exe

7
The drawFenceSegment() Function
  • It will be much easier to draw a fence if you
    first draw a segment of a fence.
  • It consists of a post, two rails, and several
    pickets.

8
The drawFenceSegment() Function
  • Use the functions drawPost(), drawRail(), and
    drawPicket(), which are provided.
  • Use a for loop to draw the pickets.
  • This unit segment will be used by drawFence() to
    draw the entire fence.

9
The drawFenceSegment() Function
  • You must align the pieces carefully.
  • The front face of the rail must be at the
    vertical centerline of the post.

10
The drawFenceSegment() Function
  • The back face of the pickets must be flush with
    the front face of the rails.
  • The posts and pickets must be separated by gaps.

11
The drawFence() Function
  • To draw the fence, you should first set the
    modelview matrix so that the current position is
    the front left corner post of the fence.
  • Then call on drawFenceSegment() repeatedly to
    draw the segments around the house.

12
The drawFence() Function
  • Draw the proper number of fence segments in front
    of the house.
  • Then turn 90? and draw the proper number of
    segments along the right side.
  • Then do the back and the left side.

13
Global Constants
  • The program contains a large number of global
    constants that govern the sizes of various
    objects.
  • Be sure to use them.
  • In fact, they should make your work easier.

14
Suggestions
  • Experiment with drawing one object at a time at
    the center of the scene.
  • FenceSegmentTest.exe

drawGround() // drawHouse() // drawTrees() //
drawBushes() // drawFence() // drawSun() glCol
or3f(1.0, 1.0, 1.0) drawFenceSegment()
15
Suggestions
  • Use a sheet of graph paper to sketch the fence
    segment to determine the proper transformations.

16
Suggestions
  • Reset the look point to special positions to
    verify that objects have been placed correctly.
  • For example, the top of the left front corner
    post should be at
  • (-28, 3.3333, 25).
  • Landscape.exe
Write a Comment
User Comments (0)
About PowerShow.com