finding a position on the uv map using a 3d position

Posted By: lostclimate

finding a position on the uv map using a 3d position - 06/07/08 11:40

I had no idea were to put this since i dont use litec and the scripting forum has been removed.

my question is, is there any functions that would lend them selves to finding the uv coordinates on an entitiys skin that correlate to were the mouse is hovering over top of them?
Posted By: flits

Re: finding a position on the uv map using a 3d position - 06/07/08 17:20

if its a terain you can calculate it yourself

else maby c_trace but i gues not

i never tried it but maby it helps you:
vec_for_uv (VECTOR*, ENTITY*, var number);
Posted By: Spirit

Re: finding a position on the uv map using a 3d position - 06/07/08 17:27

Yes, c_trace is it. Trace a ray from the camera position in direction mouse_dir3d and then the hit struct gives you the uv position on the hit texture. But this only works with lite-c because the hit struct is a lite-c struct.
Posted By: lostclimate

Re: finding a position on the uv map using a 3d position - 06/08/08 22:06

damn, im going to have to upgrade soon. oh well, ill work on it sometime.
© 2023 lite-C Forums