3d plane texture

Previous topic - Next topic

djtoon

hi a newbee question
i created a plane


X_DRAWOBJ 1, 0


X_OBJSTART 2
X_OBJADDVERTEX 170, 90, -1, 1, 1, RGB(255,255,255)
X_OBJADDVERTEX 470, 90, -1, 0, 1, RGB(255,255,255)
X_OBJADDVERTEX 170, 390, -1, 1, 0,  RGB(255,255,255)
X_OBJADDVERTEX 470, 390, -1, 0, 0,  RGB(255,255,255)
X_OBJEND

X_SETTEXTURE 0, -1
X_DRAWOBJ 2, 0

for some resont the texture dosent cover the hole plane?

the plane is 300x300
and the texture is 300x300
why is that or do i have a problem?

10x

djtoon

im adding a picture

BumbleBee

Hi and welcome

I guess your texture size is wrong. You need the power of 2. :P  Try 128*128 or 256*256 and so on... :)

Cheers
The day will come...

CPU Intel(R) Core(TM) i5-3570k, 3.4GHz, AMD Radeon 7800 , 8 GB RAM, Windows 10 Home 64Bit

Schranz0r

Some graphiccards have problems with taxtures without a pow^2!
simply resize it to 256x256 and look if it works...
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Hemlos

Coordinates for the texture might be reversed.
Yours are in this pattern of vertice ordering:
43
21

I try to use this structure if possible for proper +z camera orientation..
12
34
so the upper left or closest to 0,0 should be the first vertice then to the right 0,1
the lower left 0,1 and lower right 1,1

This should put it in the correct orientation assuming looking forward at the 0,0,0 3d coordinate from the +z direction.

And definetly use opengl standards with sizes, requires power of 2 texture sizes.
Bing ChatGpt is pretty smart :O

Moru

On platforms that can't do randomly sized textures, GLBasic is supposed to fix that automaticly to power-of-two sizes.