Texture

just make a simple applet that do texture mapping

int[[]][[]] texmap = {
{ 0x00FF ,0xFF00 , 0x00FF , 0xFF00 } ,
{ 0xFF00, 0x00FF , 0xFF00, 0x00FF } ,
{ 0x00FF ,0xFF00 , 0x00FF , 0xFF00 } ,
{ 0xFF00, 0x00FF , 0xFF00, 0x00FF } ,
};
int[[]][[]] image = { .... }
/**
  *            T                     Top
  * Source:   /\                     /|          Destination
  *          / .\ Middle     Middle / |
  *         /.                      \ |
  *       Bottom                     \| Botom
  **/
public void paintTriangleMapping
      ( Graphics,
       float dtx, float dty, float dmx, float dmy, float dbx, float dby,
       float stx, float sty, float smx, float smy, float sbx, float sby )
{
// top middle bottom // src @ dest
}

Let use a generated checkerboard first.

look at this bugged source code :

MORE

graphics.txt · Last modified: 2022/04/16 12:23 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki