POLYVECTOR UVs

Previous topic - Next topic

bigsofty

Create a new POLYVECTOR command/flag that uses proper UV texture (0..1) coordinates, instead of pixel based ones. This would allow for higher res graphics to be used without needing to change code. Scaling between resolutions/platforms would be easier as the UVs would not need to be changed. Also would allow for texture wrapping (UVs > 1).

Obviously not ideal for all occasions but it would add more flexibility to the current command. Maybe an optional flag/new command?

Cheers,


Ian
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Kitty Hello

well, just use GETSPRITESIZE and multiply with this value.
Wrapping is possible.

bigsofty

Cool, that's a nice tip Gernot, I never realised that if you put a texture coord outside the the texture range in POLYVECTOR it wraps! :D

Cheers,


Ian
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

spicypixel

Quote from: bigsofty on 2011-Apr-07
Create a new POLYVECTOR command/flag that uses proper UV texture (0..1) coordinates, instead of pixel based ones. This would allow for higher res graphics to be used without needing to change code. Scaling between resolutions/platforms would be easier as the UVs would not need to be changed. Also would allow for texture wrapping (UVs > 1).

Obviously not ideal for all occasions but it would add more flexibility to the current command. Maybe an optional flag/new command?

Cheers,


Ian

I actually messed about with PolyVectors before and achieved the tiling effect when I was trying to scale an image up. Now I actually want the tiling effect but cannot work out the PV commands to do it lol :) Anyone?
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Moebius

#4
For tiling, just set the texture coordinates to be greater than the size of the image.  (If I remember correctly, this only works 'properly' with power of 2 image sizes, otherwise you get borders in between tiles.)  You can even have negative texture coordinates.
e.g. to tile an image across the screen  :good:
Code (glbasic) Select
CONSTANT Width = 800, Height = 600
STARTPOLY 123, 2
   POLYVECTOR 0, 0, 0, 0
   POLYVECTOR Width, 0, Width, 0
   POLYVECTOR 0, Height, 0, Height
   POLYVECTOR Width, Height, Width, Height
ENDPOLY
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

spicypixel

Thank you very much  :good:
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

spicypixel

Any confirmation of what platforms it does work on. I'm really only interested in iOS and Android but can test those myself. But cheers for the heads up Ocean ;)
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Moebius

iOS, Android, Windows and Mac (AFAIK) work - haven't tried WinCE...
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

Kitty Hello

Works for all.