3D Terrain
#6
(01-09-2023, 12:12 PM)OldMoses Wrote: A couple of thoughts:

If there's a simple solution, I don't know it.

I think it would probably involve some sort of parametric algorithm after determining which triangle grid element was being approached. I've not done anything like that myself, having mostly worked with line/sphere intersections. Most line/plane intersection stuff I've looked at presumes an infinite plane, so you would need to narrow your inputs to the correct grid element with some Pythagorean checking.

https://courseware.cemc.uwaterloo.ca/web...APlane.pdf
There's lots of other stuff on parametric equations available.

The other possibility, is that you can take the plane 'normal' {i.e. perpendicular} of a target terrain grid element, and dot it with the position vector relative to that normal, updating it as you go along the path (easier to do than to describe). When the sign of the dot product result changes, you've intersected the plane, and likely gone through it. If the dot product result went to zero and stayed there, you would be moving along the plane. It would be a 3D version of what we were discussing at https://staging.qb64phoenix.com/showthread.php?tid=972  Generally, the same concepts apply for 3D as for 2D

The former would have the advantage of being able to calculate exact points of intersection, the later would be computationally simpler for a crash scenario.


Thanks for the PDF...that should help make sense of this.   Some interesting math there too...quadradic equations?  Been a long time since I've done that.

Using vector math would really open up some possibilities.   Definitely over my head but this seems like the way to go for a good 3d physics engine.
Reply


Messages In This Thread
3D Terrain - by james2464 - 01-08-2023, 09:24 PM
RE: 3D Terrain - by mnrvovrfc - 01-09-2023, 08:29 AM
RE: 3D Terrain - by james2464 - 01-09-2023, 05:13 PM
RE: 3D Terrain - by OldMoses - 01-09-2023, 12:12 PM
RE: 3D Terrain - by james2464 - 01-09-2023, 05:26 PM
RE: 3D Terrain - by OldMoses - 01-09-2023, 06:53 PM
RE: 3D Terrain - by james2464 - 01-09-2023, 08:17 PM
RE: 3D Terrain - by MasterGy - 01-09-2023, 03:24 PM
RE: 3D Terrain - by james2464 - 01-09-2023, 05:28 PM
RE: 3D Terrain - by MasterGy - 01-09-2023, 06:31 PM
RE: 3D Terrain - by james2464 - 01-09-2023, 06:40 PM
RE: 3D Terrain - by MasterGy - 01-09-2023, 06:56 PM
RE: 3D Terrain - by james2464 - 01-09-2023, 08:20 PM
RE: 3D Terrain - by james2464 - 01-10-2023, 06:30 PM
RE: 3D Terrain - by james2464 - 01-11-2023, 07:50 PM
RE: 3D Terrain - by bplus - 01-11-2023, 08:07 PM
RE: 3D Terrain - by james2464 - 01-11-2023, 08:46 PM
RE: 3D Terrain - by james2464 - 01-11-2023, 09:53 PM
RE: 3D Terrain - by bplus - 01-11-2023, 10:34 PM
RE: 3D Terrain - by james2464 - 01-11-2023, 11:51 PM
RE: 3D Terrain - by james2464 - 01-12-2023, 04:08 AM
RE: 3D Terrain - by bplus - 01-12-2023, 05:33 AM
RE: 3D Terrain - by james2464 - 01-12-2023, 04:34 PM
RE: 3D Terrain - by MasterGy - 01-12-2023, 04:57 PM
RE: 3D Terrain - by james2464 - 01-12-2023, 05:37 PM
RE: 3D Terrain - by OldMoses - 01-13-2023, 12:11 AM



Users browsing this thread: 8 Guest(s)