Moved picked xyz location...

Blitz3D Forums/Blitz3D Programming/Moved picked xyz location...

JA2(Posted 2007) [#1]
I'm trying to get xyz coordinates from a picked location that has moved...

If I click a pickable mesh and get pickedx pickedy pickedz from the camera pick, then I rotate the model that I clicked, how do I get the new xyz values of the place that I originally clicked?

Hope this makes sense to someone :)


Stevie G(Posted 2007) [#2]
First find the picked coord in models local space and store them :

tformpoint pickedx(), pickedy(), pickedz(), 0 , model
Lpx# = tformedx()
Lpy# = tformedy()
Lpz# = tformedz()


Then after you've rotated the model, get the new picked world coords like so :
tformpoint Lpx, Lpy, Lpz, model, 0
x# = tformedx()
y# = tformedy()
z# = tformedz()


Stevie


JA2(Posted 2007) [#3]
Awesome, thanks Stevie :)