I have tried to freakin hard to get textures to work, i've tried EVERYTHING. I've looked at different tutorials for things that were different than my code and done some changes, but still no textures. All i have is 2 stupid plain triangles. I want them to have a texture. How can it be this freakin hard to get textures to work?! I need someone that actually knows directx 7 3d to give me the steps of adding a texture to something. TUTORIALS ARE NO HELP IN THIS SUBJECT, I HAVE A TON OF THEM AND THEY ALL SUCK! THEY HAVE TOO MUCH EXTRA CRAP IN THE WAY.
My monkey wearing the fedora points and laughs at you.
There have been many people complaining about this too, but it would really help you would post where your problem is... doesn't it show textures at all? Or does it give you some color change that does not look like the texture to you?
And some note: Older graphics boards sometimes can't handle textures of all formats... There are boards that don't support wide textures (textures bigger than the actual screen resolution) and there are even older boards (I think it's also a problem with dx7) that only want to take sqared textures...
And have you tried to load your textures into the texture tool and save them as texture and load them with the loadtextureEx command (or similar)...
I found the problem, I had been working with just single triangles, you can't have textures unless you divide your polygons into squares instead of trianlges.
My monkey wearing the fedora points and laughs at you.
Of course you can have one single triangle with texture. Well I think Misan's right, you just have to setup everything correctly. Why not using DirectX8 by the way? I think it's much easier to use than DX7.
- Yhoko
Try my Games
* [VB6] YDK - Yhoko's Development Kit
* [VB6] HackV1 - two-player puzzle/strategy
* [VB6] Xen - extended Gen
You can map a texture to a triangle. You just have to know what the UV values must be to get it to show up right. Basically, when you map across a quad, you are simply mapping across two triangles.
well a little explanation about the uv mapping, since it is really easy:
for each vertex you specify the uv mapping. Now you can put decimal numbers from 0 to 1 (you can put more with some additional flags set, but let's first get the basics)
u is the x axis and v the y axis (it does not really matter in 3d, just for easier explanation)
1 is 100%.
So if you have a triangle set up over those three points:
Code:
X
/ \
/ \
X___X
and you would want to put a texture on it without any distortion the u v mapping would be:
point1 : u=0.5 v = 0
point2: u=0,v=1
point3: u=1,v=1
Originally posted by Yhoko Hi Zaei! You always agree to my posts, is that good?
Usually, when its DX related =).
In DX8, you can specify a U or V value that is anywhere from 0.0f..maxTextureRepeat (this is a card CAPS value, so youll have to query the card for it). You could also probably specify a negative value, though I have never tried it. When you give a U or V value greater then one, it simply wraps the texture. For instance:
Hey Z
I haven't done this for a while, but I believe you need to set extra flags since it can just repeat textures or draw them fliped over the y axis and so on....
I would use dx8 but my computer has some crappy video card. Dx8 goes at like less than 1 frame per sec. dx7 is like 200 times faster, so if i'm going to make anything that 3d why not use something that atcually can run on my computer.
My monkey wearing the fedora points and laughs at you.