예제 #1
0
파일: Sky.cpp 프로젝트: vienis/noggit
void Skies::initSky(Vec3D pos, int t)
{
    if (numSkies == 0) return;

    findSkyWeights(pos);

    for (int i = 0; i<18; ++i) colorSet[i] = Vec3D(1, 1, 1);

    // interpolation
    for (size_t j = 0; j<skies.size(); j++) {
        if (skies[j].weight>0) {
            // now calculate the color rows
            for (int i = 0; i<18; ++i) {
                if ((skies[j].colorFor(i, t).x>1.0f) || (skies[j].colorFor(i, t).y>1.0f) || (skies[j].colorFor(i, t).z>1.0f))
                {
                    LogDebug << "Sky " << j << " " << i << " is out of bounds!" << std::endl;
                    continue;
                }
                colorSet[i] += skies[j].colorFor(i, t) * skies[j].weight;
            }
        }
    }
    for (int i = 0; i<18; ++i)
    {
        colorSet[i] -= Vec3D(1, 1, 1);
    }
}
예제 #2
0
파일: sky.cpp 프로젝트: ahpho/wowmapviewer
void Skies::initSky(Vec3D pos, int t)
{
	if (numSkies==0) 
		return;

	findSkyWeights(pos);

	for (int i=0; i<18; i++) colorSet[i] = Vec3D(1,1,1);

	// interpolation
	for (size_t j=0; j<skies.size(); j++) {
		if (skies[j].weight>0) {
			// now calculate the color rows
			for (int i=0; i<18; i++) {
				if((skies[j].colorFor(i,t).x>1.0f)||(skies[j].colorFor(i,t).y>1.0f)||(skies[j].colorFor(i,t).z>1.0f))
				{
					gLog("Sky %d %d is out of bounds!\n",j,i);
					continue;
				}
				colorSet[i] += skies[j].colorFor(i,t) * skies[j].weight;
			}
		}
	}
	for (int i=0; i<18; i++) 
	{
		colorSet[i] -= Vec3D( 1, 1, 1 );
	}
}
예제 #3
0
파일: sky.cpp 프로젝트: MgCore/mcapps
void Skies::initSky(Vec3D pos, int t)
{
	if (numSkies==0) return;

	findSkyWeights(pos);

	for (int i=0; i<18; i++) colorSet[i] = Vec3D(0,0,0);

	// interpolation
	for (size_t j=0; j<skies.size(); j++) {
		if (skies[j].weight>0) {
			// now calculate the color rows
			for (int i=0; i<18; i++) {
				colorSet[i] += skies[j].colorFor(i,t) * skies[j].weight;
			}
		}
	}
}