TWiki home TWiki > Team5 > ProjectTwo (r1.8) TWiki webs:
Main | TWiki | Know | Sandbox
Team5 . { Changes | Index | Search | Go }
Beginning preliminary work on the project. I've initialized the CVS repository with project/solution files; geometry.cpp/.h are in and added; openGL.cpp is also in CVS but is not included in the project.

-- BrianYoung - 02 Oct 2004

Divided work for basic stuff, and discussed how actual classes are divided.

-- BrianYoung - 02 Oct 2004

Well, because I don't know how C++ vectors work, there's a bug in the world destructor. This note is mainly here for my reference so I can find it later. I also massaged the files to make dependencies work, and added return false to all the undone collision detections so we could at least get a build.

Instead of just boolean collision detection functions, do we want two sets: alphaCollide to return the time at which the collision will take place (1.0 being never) and normalCollide to return the normal vector it could occur with? Then in our timestep function, we call alphaCollide on all the triangles, decide which will collide first, then normalCollide on just that one.

-- BrianYoung - 04 Oct 2004 (let me know if I'm coming off as bossy)

Fixed the destructor bug; found that the vector was storing copies of our Triangles after all. Also implemented the world timer, and a world pause. Current state of project - white ball on green background, press space to make the ball start or stop moving.

Also, in golf.cpp there is commented code for timeStep that just needs alphaCollide and normalCollide implemented, and will be ready to go. Next up - make the ball feel gravity!

-- BrianYoung - 05 Oct 2004

GolfWorld? and GolfBall? classes are done. World is stored as global _world; ball is stored as _world._ball. CollisionDetector? should have an alphaCollide function that takes a ball and a triangle and returns the float betewen zero and one when they will collide; and a normalCollide function that takes the same and returns the normal that they'll collide with. After that, uncommenting the code in timeStep should make it work nice and happy (and removing the _ball.move(1) at the end).

I can answer questions. I have an algorithms test, thoguh, aso I may not get much coding time in. I'm in a big hurry.

--Brian

So, I've gone through the CollisionDetector? stuff to make it fit with current variable names and whatnot. The next step here is to implement the alphaStep function Brian wants; that should be relatively straightforward, as the three collision algorithms (edge, face, and vertex) return the alpha values; we just run all the possible cases and return the smallest alpha. The normal one will be a bit different; (for one thing, we'll need to implement calculating the normal vectors) and then get it to return that. The best way to do this is probably to have the functions that are already written return (alpha, normal) pairs and then have the normalCollide just use the same results as the alphaCollide so we don't check everything twice.

Now, however, I am going to sleep. I'm going to be really busy tomorrow, hopefully not forever, with PLs homework; LSD after midnight and Thursday morning is always a possibility.

MacMason - 06 Oct 2004

I've added in my code for vertex collision, and I'd LOVE to have you guys look over it. Here are some of the problems I ran into: * The web page said I needed the triangle normal in my collision, and when writing it I assumed a triangle object would have something like... triangle.normal[0] or something like that. Anywho, it may not be needed. I'll look into it and see if I can work around it, but I'd still like you guys to look it over (my code is very well documented, you shouldn't have too many questions about what I'm doing with my code). * I couldn't get it to compile. I loaded stuff into a project in NET and I get a handful of errors (many are about GolfBall? in the collidor class not being an identifier). Anyways, I'll work on this a bit and let you know if I get anywhere, but there were a few other errors I couldn't fix as well, so I'm unable to test the code at the moment.

Also, I'm heading to work on interface stuff, which won't really be able to happen until I can get things compiling.

-- JasonArold - 06 Oct 2004

GolfBall? and GolfWorld? classes are now split into their own files. Also, I added a global normal(Triangle t) function that will return the normal vector to a given triangle. I'll be back in the LAC at 11; from there I'll try to get triangle standard-orientation stuff working.

Brian

Topic ProjectTwo . { Edit | Attach | Ref-By | Printable | Diffs | r1.31 | > | r1.30 | > | r1.29 | More }
Revision r1.8 - 07 Oct 2004 - 02:22 GMT - BrianYoung
Parents: WebHome
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.