Author Topic: 3d plane texture  (Read 1850 times)

Offline djtoon

  • Dr. Type
  • ****
  • Posts: 290
    • View Profile
3d plane texture
« on: 2010-Aug-01 »
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

Offline djtoon

  • Dr. Type
  • ****
  • Posts: 290
    • View Profile
Re: 3d plane texture
« Reply #1 on: 2010-Aug-01 »
im adding a picture

Offline BumbleBee

  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 891
    • View Profile
Re: 3d plane texture
« Reply #2 on: 2010-Aug-01 »
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

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5068
  • O Rly?
    • View Profile
Re: 3d plane texture
« Reply #3 on: 2010-Aug-01 »
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 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1640
  • Particle Hawk
    • View Profile
Re: 3d plane texture
« Reply #4 on: 2010-Aug-02 »
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.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1790
    • View Profile
    • Homepage
Re: 3d plane texture
« Reply #5 on: 2010-Aug-02 »
On platforms that can't do randomly sized textures, GLBasic is supposed to fix that automaticly to power-of-two sizes.