Query: painting onto models

Blitz3D Forums/Blitz3D Programming/Query: painting onto models

gburgess(Posted 2010) [#1]
I was wondering if someone could start me off...

I was wondering about writing something that involves placing decals onto 3d models. I'm thinking that there'll be some copyrect tomfoolery going on. What I really need to figure out is how to tell which part of a 2d image map the pointer will be colliding with. There are commands to do a pick with the pointer, so that's not a problem. It's linking that data up with 2d co-ordinates.


Leon Drake(Posted 2010) [#2]
shouldn't be hard if you pick the triangle with a pointer then you can get it's U and V coordinate and find the X and Y coordinate on the Texture to paint the decal at.


gburgess(Posted 2010) [#3]
Hmm, yeah, I guess I can use PickedX, PickedY, PickedZ against VertexU and VertexV...

Hmmm, yeah, the data's all there. I don't think my maths is, though! Oh well, that's what the internet's for.


Ross C(Posted 2010) [#4]
Remember there is a picked U and picked V function in the code archives. Should help quite a bit...

http://www.blitzbasic.com/codearcs/codearcs.php?code=515


gburgess(Posted 2010) [#5]
Wow, brilliant. I should've searched harder. Thanks for pointing it out.