TextureStripH
TextureStripH ImageIndex, x1, u1, v1, x2, u2, v2, ypos
 
Parameters:

    ImageIndex = The Index of the image you wish to read the pixels from
    x1 = The starting X coordinate of the strip
    u1 = The starting U coord on the source image
    v1 = The starting V coord on the source image
    x2 = The ending X coordinate of the strip
    u2 = The ending U coord on the source image
    v2 = The ending V coord on the source image
    ypos = The Y position of this strip
Returns: NONE
 

     TextureStripH draws a horizontal texture mapped strip to the current surface.


      NOTE: UV coords need to be multed by $10000 to ensure they're in the correct position 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, and the lower 16bit is 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

      * TextureStripH 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 qeues.




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 an
   ; 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 Left Strip X coord to 0  and mult it by $10000
   ; to convert it to 16:16 format
     
     u1=0 * $10000
     
   ; Set the Left 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
     TextureStripH 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 | TextureQuad | TextureStripV | TextureTri :
 


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