Polyvector query

Previous topic - Next topic

MrPlow

Hi Guys

I am using polyvector as a replacement for Stretchsprite but having an issue  with the border image getting cut off from the left side.

using this..were shx is a shift offset from the left.

ssxmod and ssymod are my scaled down width and height.

basex and basey are my 960 and 600 createscreen sprite dims

Code (glbasic) Select
  STARTPOLY 99
    POLYVECTOR 0+shx,0+shy,0+shx,0+shy,0xffffff
POLYVECTOR 0+shx,0+ssymod+shy,0+shx,basey,0xffffff
POLYVECTOR 0+ssxmod+shx,0+ssymod+shy,basex,basey,0xffffff
POLYVECTOR 0+ssxmod+shx,0+shy,basex,0+shy,0xffffff
  ENDPOLY


but as long as shx = 0 or not added then the image is shown in full...anyone know if I am missing something here ... perhaps I did not use the

Code (glbasic) Select
 
shx = 0
shy = 0
STARTPOLY 99
    POLYVECTOR 0+shx,0+shy,0+shx,0+shy,0xffffff
POLYVECTOR 0+shx,0+ssymod+shy,0+shx,basey,0xffffff
POLYVECTOR 0+ssxmod+shx,0+ssymod+shy,basex,basey,0xffffff
POLYVECTOR 0+ssxmod+shx,0+shy,basex,0+shy,0xffffff
  ENDPOLY
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

dreamerman

You probably figured it out but topic remains open so I will try to help :p
shx is same for source and destination coords? that source sprite is some kind of sprite atlas or you trying to render it as a one sprite?
Didn't play with GLBasic for some time but shouldn't those right/bottom coordinates be basex-1 and basey-1?
If your sprite is 960px width and 600px height then first pixel is 0x0, last is 959x599, wasn't it that way or I forgot something? hm..
I assume that if you are drawing with smoothing disabled it can just cut those left/top border pixels.
Check my source code editor for GLBasic - link Update: 20.04.2020

MrPlow

Hi
The sprite is the virtual screen sprite.
Wasn't aware of a -1 value for the polyvector and it works for all my other sprite renders...I think I am just missing something small...
I didn't sort it I just left it as it was before at 0 screen position.

Maybe you're correct? I will check out your suggestion. :)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs