QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: Aureal on March 27, 2018, 01:54:52 pm

Title: Mapping a texture to a cube's faces
Post by: Aureal on March 27, 2018, 01:54:52 pm
Knowing both x and y co-ordinates (which have already been projected from 3D space) of every vertex of the cube, how would I map a texture to its face(s)? I've seen examples using _MAPTRIANGLE, but I'm not sure whether I have to use it, neither how to, can I get some help?
I've attached an image for reference
Title: Re: Mapping a texture to a cube's faces
Post by: STxAxTIC on March 27, 2018, 02:05:32 pm
Hello,

I solved this a few years ago by stitching two instances of _MAPTRIANGLE together. There is probably a better way to do it, and the math got a little heavy - as the program otherwise is designed for QB45/SCREEN 12. (Take away _MAPTRIANGLE and it's back to solid colors or wireframe.)

I think I called it QUADLAND or something on the *.net forums. I can dig it out if we need, but I'm hoping there is an easier way by using GL commands more directly.
Title: Re: Mapping a texture to a cube's faces
Post by: Petr on March 28, 2018, 04:06:11 am
Hi Aureal. Try look to Galleon´s code here: http://www.[abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]/forum/index.php?topic=12257.0 he use _MAPTRIANGLE for texturing in this program.