DrawTexture

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/10/2004 at 09:25, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   9 
Platform:   Windows  ;   Mac OSX  ; 
Language(s) :     C++  ;

---------
Could you give a definition of the parameters of the DrawTexture function?

Regards,
darf

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/10/2004 at 08:23, xxxxxxxx wrote:

It would seem that they are:
bmp = texture bitmap
padr4 = array of points in the polygon
cadr = array of point colors (texture is multiplied by this)
vnadr = array of point normals
uvadr = array of UV coordinates into the bitmap
pntcnt = number of points (3 or 4)
interpolation = interpolate between pixels?
alpha mode = how to use the alpha (DRAW_ALPHA_* )
This code works for me:

    
    
      Filename fn = GeGetStartupPath() + Filename("resource/modules/xtensions/preview_scenes/xtenv1502.jpg");  
      AutoAlloc<BaseBitmap> bmp;  
      bmp->Init(fn);
    
    
    
    
      Vector padr4[] = { Vector(100,-100,0), Vector(100, 100, 0), Vector(-100, 100, 0), Vector(-100, -100, 0) };  
      Vector cadr[] = { Vector(.2), Vector(1,1,1), Vector(1,1,1), Vector(1,1,1) };  
      Vector vnadr[] = { Vector(0,0,1), Vector(0,0,1), Vector(0,0,1), Vector(0,0,1) };  
      Vector uvadr[] = { Vector(0.5,0,0), Vector(1, 1, 0), Vector(0, 1, 0), Vector(0, 0, 0) };  
      LONG pntcnt = sizeof(padr4)/sizeof(padr4[0]);  
      Bool interpolation = TRUE;  
      LONG alphamode = DRAW_ALPHA_NONE;
    
    
    
    
      bd->SetMatrix_Matrix(NULL, Matrix());  
      bd->DrawTexture(bmp, padr4, cadr, vnadr, uvadr, pntcnt, interpolation, alphamode);