Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Questions on HW6-Spring07


HW6 is due on March 14. Mark Guzdial.

TO BE COMPLETELY CLEAR: IF YOU DO NOT HAVE A PARTNER FOR HW6, YOU WILL LOSE 10 POINTS. Period. There have been lots of recitation sessions where you could go meet a partner. I'm certainly getting lots of email on this question, so there are lots of peole without partners. You must have a partner – and your code must represent each partner's work 50-50 and we must have a signed statement agreeing to that. We've been talking about this for weeks, it's been here on the CoWeb. No partner == one letter grade drop. Mark Guzdial

Question: How can I change the number of frames per second that my animation plays? Right now it's playing one frame every 5 seconds or so.

Question: When I run my animation , I get this error: OutOfMemoryError: Java heap space
Why the heck does it give me this error. It runs the animation for about 10 frames, and then it gives me the error.

Question: In my animation I want to use LayeredSceneElements so that I can layer my pictures in my animation (say I want something appear to walk behind an object in the picture). Can I use LayeredSceneElement in a tree? It seems to me that I should be able to use it by making the linked list and inserting the entire list as one child to a branch. Because the branch understands ‘addchild’ it doesn’t matter what I make as a child does it?

Right now I am basically wanting to use LayeredSceneElement to position my pictures on a background, then render the background, then move some of the layered scene elements a little bit and then re-render, etc. My Problem is that I am not exactly sure how this would fit into a tree with branches and such. I mean why do I need a root and branches and such if I can just use a FrameSequence of a bunch of LayeredSceneElements?



Question: I am trying to get the sounds to play with the animation and am trying to figure a few things out. I made a linked list of sound nodes in the setup on the animation that corresponds with the number of frames the animation contains. I did this because I wanted to play one node with each frame and then when the frame changes and re-renders the next sound plays etc. The problem I am encountering is playing only a single sound node. playFromMeOn() plays the entire linked list. I was wondering how I could say current = first sound node, play that node, then current=current.getNext().

You said that if you use SoundElement to create a linked list of Sounds you could use current.play() to play the individual sound. I am still getting an error saying that the method play() is not in SoundElement: any ideas?
cannot find symbol
symbol  : method play()
location: class SoundElement

Question: When I try to play my AnimationRunner, I get the error "NullPointerException", and then refers to line 108, which is where we first try to move an object. All of the code compiles, and everything before that (setUp and renderScene) works. What does that error mean, and what are ways that we can fix it? Thanks!

(Referring to the previous question) I think we have an object to move, because when we render just one frame, it works (all the pictures come up, etc.) It's just when we try to move this first object/picture the first time and we get a NullPointerException. Do we have to do casting anywhere in our code? We pretty much followed the wolfattackmovie, and there wasn't any in there....

Question: frames = new FrameSequence("C:/Temp/"); Why is this line in our wolf attack movie? if we're using wolf-attack movie as a template, what should this line be replaced with (if it needs to be replaced at all)?

Question: Is there a way we can change the amount of java heap space for memory in Dr. Java?

Question: On the question about the Drjava heap space... do you know where in the book it explains how to do add more? I know I have read it somewhere, but now I can't find it.

Question: What's the best way to outline a picture? For instance, I have a picture that I want to show on a background, but when I put it on the background the white space of the picture shows up. Do you know of any program that will allow me to save a picture without all of the extra white space?

Question: Turn in ALL the classes that you're using for your data structures. (You don't have to turn in Picture, Sound, FrameSequence, or its related structures (unless you've changed them), but everything you're using for keeping your sound list and scene structure.)
That above is what the hw description says. So, if I didn't modify SoundElement or ScaleBranch, would I still turn them in? Or, is this referring to those people who have set up their linked lists in another class aside from the AnimationRunner class. Could you please provide clarification on what this is asking. According to my interpretation, I didn't manipulate any other classes, even though I called an instance of them like scaleBranch, so I would only turn in my AnimationRunner class.
Question: Yeah I have the same question as the one above. Would we turn in things like Branch.java, MoveBranch.java, BlueScreenNode.java, etc. even if we didn't modify them?

Question: when using songNode or songBranch when we play the list of sounds, the sounds are streched and play slowly... how can we fix that?

Question: I can't seem to make my linked list of sounds work. I did SoundElement current = splash1 (my first sound node), current.getSound().play(), then current=current.getNext() but I can't get the for loop cintaing my frames and this code to cycle through my Sounds. What do I need to do instead?
lol, sorry my typing sucks. I meant containing but nevermind anyway. My partner figured it out.

Question: I want to have a picture come in from the top of the screen. For example, say I wanted to animate a skydiver falling, and I wanted to show him entering the screen from the top (seeing his feet, his legs, his torso, etc...) and leaving the screen at the bottom (no longer seeing his feet, no longer seeing his legs...). I know how to show him leaving the screen, because you can just insert the picture progressively lower, but I can't figure out how to show him entering the screen. Any suggestions?

Question: I tried entering in negative coordinates and I got an out of bounds error. Is that what you meant by making him be less than (0,0). What am I not doing?

Class is moved to Management 102 on Friday 10-11 am. The Architecture auditorium is going to be used for the memorial service for Dean Tom Galloway. Mark Guzdial

BTW, getSound().play() works, but so does .blockingPlay() and .playSound() in SoundElement. Mark Guzdial

Question: If we do getSound.play(), can we tell the playback to stop at a certain point? For instance, after we've done a certain number of frames, we want the playback to stop no matter what; is that possible?

Question: There is a time in out animation (towards the end) where we have a picture that we want to remove and another one to add. We have the this.root().remove(....) and this.root().addChild(...), but when we run the animation, the picture that we want to remove doesn't go away. In previous times that we removed pictures, they went away. Why is that picture not going away????

Question: what was the avg for test 2?

Question: Looking at the homework criteria it says that we will be penalized if we only use one or two types of sound. What is meant by types of sound? This means we have to use multiple "types" of sound? Please explain.
Question: the criteria states that we have to have at least 5 nodes in our sound linkedList... can some of these nodes be rests? And to create our linkedList using sound elements can we treat them as sound nodes
Question: how would i play this list of sounds? Thank You!

Question: Do we need to turn in MoveBranch, HBranch, BlueScreenNode, and SoundElement if we did not change them at all???

I am getting a null pointer exception. I tried running wam.renderScene() after setting wam to be a new WolfAttackMovie, just to see if it would work with code I didn't write, but I get the same error. Any help?

Nevermind. I was forgetting to setUp() first.

Link to this Page