![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Yes, all you have to do is create the image. You don't need to write to a file because your resultant image should look the image provided on the Take-Home Exam page. Your TA will only setMediaPath() and then execute exam1(). Angela Liang |
| It should show() the image – I'll add that to the problem. Mark Guzdial |
| The take-home exam is due on Friday, Oct. 3 at 5 pm. Angela Liang |
| Notice where the diagonal line meets. The space between the original image and the mirrored image is very close. We expect there to be a little difference between the image we have and the image you are expected to produce. But no more than 5 pixels of whitespace. We also don't want the image to overlap when mirrored. Therefore, pay close attention to the diagonal line when looking at your resultant image. Hope this helps. Angela Liang |
| Just the code. Angela Liang |
| Yes. |
| Yes, there's more than one way to do it. As long as the effect is the same, you can use the order you'd like. Mark Guzdial |
| Yes, I am willing to accept either one. Mirroring the canvas is easier, of course – you only have to do ONE mirroring. Mark Guzdial |
| Cool! For everyone else who was wondering similar wonderings: Think about the mirrorpoint as LITERALLY the place where the mirror is. How does the image get onto the mirror? We copy pixels from the image side of the mirror onto the mirror. If the mirror is on a vertical line, than pixels to the left of the mirror are less than the mirrorpoint (e.g., mirrorpoint-x). Pixels to the right of the mirror are more than the mirrorpoint (e.g., mirrorpoint+x). If the mirror is on a horizontal line, than the top is less than the mirrorpoint (mirrorpoint-y) and the bottom is more than the mirrorpoint (mirrorpoint+y). To get the image onto the mirror copy the pixels from one side to the other. If we're copying top to bottom, we copy mirrorpoint-y to mirrorpoint+y. Hope that helps! Mark Guzdial |
| For anyone that's having problems with mirroring, the TAs will be going over mirroring in recitation this week. Angela Liang |
| In general, if you reference an index (your X and Y in getPixel or setPixel) is beyond the getHeight or getWidth of the picture, you'll get this error. The best way of tracking these kinds of errors is to use a Print statement to see the values and see what values you have. Mark Guzdial |
| Maybe you're accidentally returning the figure and not the canvas? I don't want to go any further down this path – we can't be debugging your program. Mark Guzdial |
| If you've already opened the picture once in the picture tool, it will only open that picture until you restart JES. This is a bug that is fixed in the new version of JES: Course Software (JES) Adam Wilson |
| Shouldn't matter. Just setMediaPath and use getMediaPath in your program, and you don't need any directory paths. Mark Guzdial |
| It really doesn't matter what you put in for targetX and targetY? In that case, I'd wonder if your loops are working at all. If you have a loop like this: for sourceX in range(1,1):, the loop never even starts. You might put in some print statements to find out what's going where. Mark Guzdial |
| Because makeColor() always takes its inputs in the same order: red, then green, then blue. If you instead pass in the inputs blue, red, green (for example), then the colors will get juggled. Mark Guzdial |
| yes, you can still use other functions. Just make sure your main function is exam1(). Angela Liang |
| Yes, that would be a problem. You fix it by setting targetX and targetY so that the images compose in the upper left hand corner. Mark Guzdial |
| Just this picture. Mark Guzdial |
| Open up your program. Then save it. Then hit load. After you have loaded it, type in exam1() (which should be the name of your program) in the command area and hit enter/return. It should run the program and show the canvas. |
| That answer is right, but how did you get all the other homework turned in? Mark Guzdial |
| In the MediaSources directory on your CD. Mark Guzdial |
| It can't be correct if you're getting that error. Try rewriting the line it's complaining about. Use more or fewer parentheses so that you're doing something different. Check all your spacing. Mark Guzdial |
| It should be in the upper LEFT hand corner, not the lower right. We discussed how to get it in the upper left in class. Mark Guzdial |
| By saving it on your computer from the Take Home Exam page. Read the directions there. Mark Guzdial |
| Neither. The Media Path should be set to the DIRECTORY where the media are, not just the drive. Keep clicking until you get to your MediaSources directory. Mark Guzdial |
| 5:00 pm EDT today (Friday, October 4, 2003). Mark Guzdial |
| All the slides are on the Web on the Syllabus page. Look at the slides on pixels by index number. Mark Guzdial |