Timeline for Finding Z given X & Y coordinates on terrain?
Current License: CC BY-SA 3.0
17 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 28, 2013 at 9:47 | history | tweeted | twitter.com/#!/StackGameDev/status/405996299017015296 | ||
| Nov 15, 2013 at 23:39 | vote | accept | Sparky | ||
| Nov 15, 2013 at 9:53 | answer | added | Helbreder | timeline score: 1 | |
| Nov 14, 2013 at 23:09 | comment | added | Helbreder | let us continue this discussion in chat | |
| Nov 14, 2013 at 22:57 | comment | added | Sparky | Awesome! Thanks for taking the time to do that. I really appreciate that. After your changes does it yield any results? Is there anything else I should experiment with? | |
| Nov 14, 2013 at 22:00 | comment | added | Helbreder | I stepped over a SSCCE couple of times to understand how it works and these are the clues I found: * there's a typo in tri2 definition - first two vertices have the same coordinates. I've changed second one to (18.0000000, 34.0000000, 2.70000005) for testing purposes. * given vertices form triangles with clockwise windings. This states, by default, that both triangles are turned away from a ray's direction. I've reversed ray's direction so the ray shoots up from below triangles. * I think only dir vector should be normalized in normalizedIntersectRayTriangle function call. | |
| Nov 14, 2013 at 18:05 | comment | added | Sparky | I see what you're saying. I'll see what I can do. | |
| Nov 14, 2013 at 17:11 | comment | added | Helbreder | The only thing I can think of are those ray direction coordinates. I don't know how exactly =glm::intersectLineTiangle= works internally, but thinkng about a ray direction vector, coordinates should be in a form of a (0, 0, -x) for it to point exactly down from a origin point. | |
| Nov 14, 2013 at 14:33 | comment | added | Sparky | You're right! I'm sorry, that was a mistake in the post. The actual z value for ray direction is -10.0. See the SSCCE. | |
| Nov 14, 2013 at 14:32 | history | edited | Sparky | CC BY-SA 3.0 |
Fixed a mistake in ray direction.
|
| Nov 14, 2013 at 8:30 | comment | added | Helbreder | Ray origin and direction have the same coordinates. Shouldn't the z coordinate be negative in direction vector for a ray to point down? | |
| Nov 14, 2013 at 2:22 | history | edited | Sparky | CC BY-SA 3.0 |
added 163 characters in body
|
| Nov 13, 2013 at 19:49 | comment | added | Evan | Try normalizing your dir vector before passing it in. Functions like this almost always expect a normalized vector, and anything else could cause problems. | |
| Nov 12, 2013 at 19:03 | history | edited | Sparky | CC BY-SA 3.0 |
Debugging information
|
| Nov 12, 2013 at 0:13 | comment | added | David Cummins | Possibly the ray you define isn't guaranteed to intersect with the triangles (e.g. origin is too high/low), or you are experiencing floating point issues with the edges of the triangles. | |
| Nov 11, 2013 at 21:20 | comment | added | House | Possible duplicate: gamedev.stackexchange.com/questions/31844/… | |
| Nov 11, 2013 at 21:13 | history | asked | Sparky | CC BY-SA 3.0 |