Project 3 Landscape Mon, Oct 6, 2003 Due Wed, Oct 15, 2003.
-
Upload
doreen-thompson -
Category
Documents
-
view
216 -
download
0
Transcript of Project 3 Landscape Mon, Oct 6, 2003 Due Wed, Oct 15, 2003.
Project 3
LandscapeMon, Oct 6, 2003Due Wed, Oct 15, 2003
Landscape
Read the handout.Download the files. Landscape.cpp. point3.h.
Run Landscape.exe.
Landscape
Your job is to write the functions that draw the trees and the fence. drawTrees() drawOneTree() drawFence() drawFenceSegment()
The drawTrees() Function
The drawTrees() function should set the modelview matrix for each individual tree and then call on drawOneTree() to draw the tree.
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.
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
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.
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.
The drawFenceSegment() Function
You must align the pieces carefully.The front face of the rail must be at the vertical centerline of the post.
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.
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.
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.
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.
Suggestions
Experiment with drawing one object at a time at the center of the scene.FenceSegmentTest.exe
drawGround();// drawHouse();// drawTrees();// drawBushes();// drawFence();// drawSun();
glColor3f(1.0, 1.0, 1.0);drawFenceSegment();
Suggestions
Use a sheet of graph paper to sketch the fence segment to determine the proper transformations.
Post
Rail
Picket
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