Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // temp.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- int main(int argc, _TCHAR* argv[])
- {
- // D +/- {(1-C)* A + C * B}
- float textureColor[] = {1.0,0.5,0};
- float rasterColor[] = {1.0,0,0};
- float SetZero[] = {0.0,0.0,0.0};
- float SetOne[] = {1.0,1.0,1.0};
- float* A = SetZero;
- float* B = SetOne;
- float* C = textureColor;
- float* D = rasterColor;
- bool add = true;
- float EndColour[3];
- for(int i=0;i<3;i++)
- {
- float tA = (A != NULL ? A[i] : 0);
- float tB = (B != NULL ? B[i] : 0);
- float tC = (C != NULL ? C[i] : 0);
- float tD = (D != NULL ? D[i] : 0);
- if(add)
- EndColour[i] = (tD) + ((255 - tC) * tA + tC * tB );
- else
- EndColour[i] = (tD) - ((255 - tC) * tA + tC * tB );
- }
- printf("end colour: %f %f %f\n",EndColour[0],EndColour[1],EndColour[2]);
- char pause[2];
- scanf("%d",pause);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement