Retroactive journal entry
Day 3 part 1-Retroactively updated journal
-Added screenshot.
Day 2
-Too many other things to do. Really shouldn't be working on this.
-Experimented with pygame.mixer
Seems to work ok.
Still need to find sounds that's not just those on the hard disk. Although they do come from open source programs.
Also have to find something to use for the main sprite (this should really be a priority).
-Added some story element triggers.
-Spent yet another hour on the line segment intersection algorithm...
Day 1
-Completed basic mechanics
-Spend 1-2 hours on determining if two line segment intersect(!)
Shouldn't there be some well known numerically stable algorithm or a module?
-Other things seem to be taking less resources than expected.
-This is nowhere near done and there is not much time left.
Originally, only 1 day was planned...
(log in to comment)
Comments
The other thing is that I'm not quite sure what to do in the collinear case. I'm currently using a coordinate-wise "inbetween" test (check if one endpoint of line1 is between the endpoints of line2). But I'm running this test along with the counter-clockwise time whenever the lines' direction vectors are (near) parallel (by taking the dot product). But again, I'm not sure if what I'm doing is numerically stable (especially with short line segments)
Tee on 2009/09/01 19:34:
About finding an intersection between two segments, I'm not sure if you're already using this (if you are, sorry for being superfluous, but just in case), given points x = (x0, x1), y, z, remember that the determinant of the matrix ((x0, x1, 1), (y0, y1, 1), (z0, z1, 1)) gives you the twice the area of xyz triangle in counterclockwise direction. Which means, if that's positive, then z is to the left of the xy segment, and if it's negative, then z is to the right (if it's zero, then it's collinear). With this, it should be straightforward to calculate intersection, just check if each point of a segment are in opposite sides of the other segment (do it for both of them).(I think the determinant can be simplified to (y1 - x1)*(z2 - x2) - (z1 - x1)*(y2 - x2) -- or something like that, not sure if this is right.)
(Ok, now I should stop reading posts and lurking on IRC and start working on my game...)