Help with math stuff

May 13, 2007 07:36

We're doing our first major(-ish) game project and I've got a problem ( Read more... )

Leave a comment

Comments 2

hitchhiker May 13 2007, 15:32:31 UTC
So basically the two children are flying off in opposite directions along the same straight line, at right angles to the parent's direction of travel? That sounds like it would look unrealistic; what I'd do is have parallelSpeed and transverseSpeed properties for each child, let child1.parallelSpeed = child2.parallelSpeed = parent.parallelSpeed, and child1.transverseSpeed = -child2.transverseSpeed. Then use vector decomposition and addition to convert the parallel and transverse components to x and y components. As for where they start, you want to draw a triangle OAB whose apex O is the point where the parent split, whose sides OA and OB are oriented along the velocity vectors of the children, and whose side AB is the sum of their radii ( ... )

Reply

malorion May 17 2007, 04:19:34 UTC
Thanks you so much for that, zem. Before I saw your reply, I fudged it by setting the speeds as I mentioned before and the position as parentX+(xSpeed*radius) and same for the y. The result worked better than I expected and was a good temporary fix. Once I saw your solution, what one of the other students had been telling me started to make sense, so I put that in place and the asteroid's separation looked a lot more realistic. Sorry I didn't replay at the time, things have been a bit frantic over the last few days. Now I'm in wind-down mode ( ... )

Reply


Leave a comment

Up