finding UV coords within a triangle

Blitz3D Forums/Blitz3D Programming/finding UV coords within a triangle

DougUK(Posted 2003) [#1]
Hi all,
I'm trying to find UV coordinates within a triangle.
I know the coords of x,y,z and u,v of all 3 points of the triangle but cant seem to find the UV coords if clicked inside the triangle with the mouse pointer.

any help will be much appreciated?

thank you


Beaker(Posted 2003) [#2]
http://www.blitzbasic.com/codearcs/codearcs.php?code=515


DougUK(Posted 2003) [#3]
thank you MasterBeaker, will take a look at that :)


StOrM3(Posted 2003) [#4]
I too am interested in this, as I would like to make a program similar to tatoo, letting you paint on models texture then save the model back out as a B3D.

Anyone have some example code showing how to do this, would be greatly appreciated.

Thanks,

Ken


fredborg(Posted 2003) [#5]
StOrM3: PlEaSe ReAd ThE pReViOuS PoStS!!!



DougUK(Posted 2003) [#6]
thankx to masterbeaker for pointing me in the right direction and a big thankx to fredborge for creating the functions, excellent work and just what i was looking for :)

cheers