TextureStripV
TextureStripV ImageIndex, y1, u1, v1, y2, u2, v2, xpos
 
Parameters:

    ImageIndex = The Index of the image you wish to read the pixels from
    y1 = The top Y coordinate of the strip
    u1 = The top U coord on the source image
    v1 = The top V coord on the source image
    y2 = The bottom Y coordinate of the strip
    u2 = The bottom U coord on the source image
    v2 = The bottom V coord on the source image
    xpos = The X position of this strip
Returns: NONE
 

     TextureStripV draws a vertical texture mapped strip to the current surface.

      NOTE: The UV coords need to be multed by $10000 to ensure their in the correct format for use with texture stip commands. (See bellow for reason)




FACTS:


      * UV coords (the X/Y coords on the image) need to be in 16:16 format. Which means that their a 32bit integer, broken up into two halves. The upper 16bits are the whole number part, while the lower 16 bits are the fractional part. This is useful when doing your own edge/effects calculations and then feeding the result directly into the strip render routine as it avoid truncating the UV values.

      * UV coords should always be positive.

      * UV coords should range between 0 and the source textures width/height minus 1. So To the set the U to the images right hand edge you'd go U= (Width-1) * $10000

      * TextureStripV will render to the current surface, except when the user has either CaptureToScene, or CaptureToWorld activated. In either situation the drawing request will be added to the scene or world queues.





Mini Tutorial:


      This example draw a bunch of texture mapped strips from a source image.

  
  
; create a fx image for us to render texture strips from
  CreateImage 1,100,100
  RenderToImage 1
  For lp=0 To 100
     CircleC Rnd(100),Rnd(100),Rnd(10),1,RndRGB()
  Next
  RenderToScreen
  PrepareFXImage 1
  
  DrawImage 1,50,50,0
  
  
; draw 100 strips
  For lp =0 To 100
   ; calc the UV coords on the source image
     
   ; remember UV coords are stored in 16:16 format.
     
   ; So the whole part is in the top 16bits and
   ; the fractional part is in the lower 16bits.
     
   ; If you don't know what that means, then just
   ; mult your UV's by $10000.  Which will give the
   ; texture routines the correct texture coords in
   ; most cases
     
   ; Set the Top Strip Y coord to 0  and mult it by $10000
   ; to convert it to 16:16 format
     
     u1=0 * $10000
     
   ; Set the Top Strip V coord to lp  and mult it by $10000
   ; to convert it to 16:16 format
     V1=lp * $10000
     
     u2=100 * $10000
     V2=lp * $10000
     TextureStripV 1,300-lp,u1,v1,400+lp,u2,v2,50+lp
  Next
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



 
Related Info: GouraudQuad | GouraudStripH | GouraudStripV | GouraudTri | ShadeBox | TextureQuad | TextureStripH | TextureTri :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com