Edit: Question needed rephrasing.
I am rendering a set of terrain based on a heightmap and then loading in xyz points that I would like to generate lines from. I would like the data's Y to stick to the terrains Y. Is there a simple method to do this? I looked at getCollisionPoint(...) but this requires me to give a ray when all I want to know is if the point is above or below. If so draw at the terrains Y. I am having a hard time wrapping my head around this so any insight would be awesome.
Thanks and hope I explained that well.
[solved] Drawing a 3D line to terrain heightmap
[solved] Drawing a 3D line to terrain heightmap
Last edited by trnrez on Thu Jan 15, 2009 10:34 pm, edited 1 time in total.
Jon Jones
Portfolio - needs updating
Portfolio - needs updating
Possible Solution
If anyone can give me a better solution that would be awesome but how bad does the below sound.
I make a collision point to test against that is extremely way up in the Y and one that is extremely way down in the Y. Then use getCollisionPoint(...) to find out if that ray has an intersection to the terrain.
Thanks.
I make a collision point to test against that is extremely way up in the Y and one that is extremely way down in the Y. Then use getCollisionPoint(...) to find out if that ray has an intersection to the terrain.
Thanks.
Jon Jones
Portfolio - needs updating
Portfolio - needs updating
Code: Select all
terrain->getHeight(f32 x, f32 y)
If not, then sorry, I don't quite get what you're trying to do.
In a 3d application that would be called projecting a spline.... Unfortunately I can only guess on how one would go about to do ths... Starting with the 3d lines which itself can be quite difficult from my experience.... See this thread. I would think something like get closest vertice... maybe check out how mouse picking determines its position. Sorry haven't looked into it...
good luck
good luck
How did I not notice this in the documentation?! Must of skipped over cause that is exactly what I was looking for! Thanks for the help Eigen. Works perfect now.Eigen wrote:?Code: Select all
terrain->getHeight(f32 x, f32 y)
If not, then sorry, I don't quite get what you're trying to do.
But what I don't get is why it is called getHeight yet names the vars (x,y) shouldn't this be (x,z)?
Jon Jones
Portfolio - needs updating
Portfolio - needs updating
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Quite probably. By default, the coordinates will be X,Z and the height will be Y. However, the terrain could be rotated.trnrez wrote:But what I don't get is why it is called getHeight yet names the vars (x,y) shouldn't this be (x,z)?
How about longitude and latitude?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way