I had somebody work on a small 3D project, so I already have a portion of the work ready. See attachement for the code (you are not allowed to use it without permission). What's been done:
1) a function to measure the distance from a 3d segment to a 3d planar convex that returns the closest points if there is no intersection (distance !=0)
2) a function to return the z value of a x-y point of the convex
Here are my needs:
- function 1) should return only one thing, a number representing
-- if there is an intersection, the distance from the first point of the segment to the intersection point
-- if there isn't, the distance from the first point of the segment and closest point of the convex polygon as a negative value
- a function to measure the distance between 2 segments, which returns a number representing
-- if there is an intersection, the distance from the first point of the first segment to the intersection point
-- if there isn't, the distance from the first point of the first segment and the closest point of the second segment
- a function that, given a 3d point and a 3d planar convex, returns
-- if the point is above the convex or part of it, the distance from the convex
-- if the point is under the convex or not part of it, the distance from the convex as a negative value
- a function that, given a 3d point and a 3d planar convex, returns the x-y direction (360 degrees) to take to get away from the convex as fast as possible (this function could make use of the above one)
- take all the above functions and make a Game Maker compatible dll out of it (it has to receive and return doubles only). Here is a small guide you can use
[login to view URL]
- use Code::Blocks
- comment your code in English
- try not to use classes, templates and other code structures when not needed