Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Problem with texturing object made from memblock mesh

Author
Message
soadjason
21
Years of Service
User Offline
Joined: 8th Apr 2005
Location:
Posted: 19th Feb 2011 16:41
My texture just turns object green. I'm assuming it has to do with uv texture coords, but I do not completely understand them.



Jimpo
21
Years of Service
User Offline
Joined: 9th Apr 2005
Location:
Posted: 19th Feb 2011 17:33 Edited at: 19th Feb 2011 17:34
Yeah, it is a problem with your uv coords. You set them all to 0.0, so you're object won't properly texture. The uv coordinates are fractional numbers (0.0 - 1.0) that map to the xy coordinates on the image used as a texture. So 0.0,0.0 is the top left corner of your image and 1.0,1.0 is the bottom right.

For example, changing your code to this will make each tile on your terrain be textured with the entire image.


Just play around with the uv coords to get a better understanding of how they work.

soadjason
21
Years of Service
User Offline
Joined: 8th Apr 2005
Location:
Posted: 19th Feb 2011 17:44
Wow, that was an easy fix. Thanks for the help and info, Jimpo

Login to post a reply

Server time is: 2026-07-17 13:59:53
Your offset time is: 2026-07-17 13:59:53