BASIC

Author Topic: Polyvector query  (Read 571 times)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1330
    • View Profile
Polyvector query
« on: 2018-Jun-28 »
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

Offline dreamerman

  • Mr. Polyvector
  • ***
  • Posts: 208
    • View Profile
    • my personal website
Re: Polyvector query
« Reply #1 on: 2018-Jul-19 »
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

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1330
    • View Profile
Re: Polyvector query
« Reply #2 on: 2018-Jul-19 »
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