Friday, 6 April 2012
Worksheets!
I was sick Monday of last week, so I only came to class on Tuesday, during which I did 6 worksheets and 2 labs, and I don't have a lot of commentary on the subject other than that the worksheets seem very repetitive, and providing the same methods with many different input values doesn't seem to be teaching me anything.
Java, not in 3d
Last weekend, while I was sick, I made a very small 3D engine, using a very primitive method used by very early 3D engines. This bases around the equations
x = x1/z1
y = y1/z1
where x and y are the 2D points to be displayed and x1, y1, and z1 are the input coordinates for the 3D point. This equation simply scales the x1 and y1 coordinates of the 3D point by the z1 position, in order to create a sense of depth. The "camera" is centered at the origin. Then, one does a series of modifications to make this work with alternate directions, camera positions, and field of view. Up until now Daniel has been looking through different forms of 3D rendering and I can definitely see myself going down the same path.
x = x1/z1
y = y1/z1
where x and y are the 2D points to be displayed and x1, y1, and z1 are the input coordinates for the 3D point. This equation simply scales the x1 and y1 coordinates of the 3D point by the z1 position, in order to create a sense of depth. The "camera" is centered at the origin. Then, one does a series of modifications to make this work with alternate directions, camera positions, and field of view. Up until now Daniel has been looking through different forms of 3D rendering and I can definitely see myself going down the same path.
Thursday, 8 March 2012
Code Wars
The problems given at code wars were... interesting. They all had quite a bit of variation between, and the majority of them were difficult but doable. Some of them would be simple to very experienced coders (Maze solving algorithm), but would be out of reach of beginners. In general the questions were very well put together, and favored elegant design over large switch cases. The throw away questions were sparse and didn't get in the way of proper challenges, and the hard questions were appropriately scored. The only problem was the internet, and that's a technical problem, not a design problem.
Most importantly, though, the jokes were only slightly stale.
Most importantly, though, the jokes were only slightly stale.
Wednesday, 29 February 2012
Poing
Last weekend I made a vector class, though it didn't support dynamic vectors. Thus, I threw together some extremely bad code to remake the vectors for the paddles every cycle. This worked well enough, but the hit testing on the sides of the paddles is extremely inaccurate. Generally I have enjoyed this project, having more involved labs I find to be much more enjoyable than the simple ones we have had in the past.
Wednesday, 22 February 2012
Vectors!
Last weekend I derived an equation to find the distance from a line to a point and implemented this into an algorithm in a vector class. In order to do this in an appealing way I taught myself about nested classes (quite simple) and Image IO. (Although I couldn't recite the code, this also proved to be fairly simple.) Currently I'm trying to figure out how to make an efficient and simply way to present a class that will run saving the vectors and generate a corresponding image to run alongside the vectors, with my goal being making a randomly generated top-down game.
I don't have any major commentary on the class except that some of the worksheets did seem superfluous, though I did get a fair amount of the questions wrong so I can't honestly present any criticism on the issue.
Wednesday, 15 February 2012
Late late post
Last week we learned about inheritance, interfaces, and static classes. These are three things that I have wanted to have formally explained to me for a while, so these presentations were fairly interesting. However, the worksheets felt extremely repetitive; Some of them were the exact same code as another worksheet but with different variables.
Other than that, the labs seem to be getting harder, which is nice as they can serve as more than 30 seconds of quick coding. That being said, I don't see a reason that, at this point, the class can't just write the code entirely from scratch rather than using partially prewritten classes. The only thing that was necessary for the pong lab that hasn't been taught yet was graphics, and it wouldn't be hard to provide a graphics library.
Monday, 6 February 2012
Arduino
This week we reviewed oop, nothing I can comment on there.
SO I got an electret microphone with the intent to use it with my arduino, however I found that my arduino would not pick up the signal from the microphone if I hooked the mic up the same way I would a button or photoresistor. Thus, I did a little more research and purchased a 386 amp to amplify the signal, as well as capacitors and resistors to regulate the voltage. The arduino is now picking up the signal to a degree, though it still is not responding to sound. What I did notice, after reading the datasheet, is that the mic gives the raw audio waveform, with values alternating and varying 0 to 100 or so.
Subscribe to:
Posts (Atom)