material.cpp

来自「file code.zip are used to implement ray 」· C++ 代码 · 共 50 行

CPP
50
字号
#include "Material.h"void Material::setDefault(){	// Standard Material Textures and Parameters    textureType = 0; // for none    numParams = 0;        // Whitted Variables    reflectivity = transparency = 0.0;    speedOfLight = 1.0;    nudgeValue = 0.000001;    // Other variables    specularFraction = 1.0;    surfaceRoughness = 0.5;	specularExponent = 1;        // Standard Material Colors    ambient.set(0.1f,0.1f,0.1f);    diffuse.set(0.8f,0.8f,0.8f);    specular.set(0,0,0);    emissive.set(0,0,0);}void Material::set(Material m){    // Standard Material Textures and Parameters    textureType = m.textureType;    numParams = m.numParams;    for(int i = 0; i < numParams; i++) params[i] = m.params[i];    // Whitted Variables    transparency = m.transparency;    speedOfLight = m.speedOfLight;    reflectivity = m.reflectivity;    nudgeValue = m.nudgeValue;    // Other variables    specularFraction = m.specularFraction;    surfaceRoughness = m.surfaceRoughness;	specularExponent = m.specularExponent;        // Standard Material Colors    ambient.set(m.ambient);    diffuse.set(m.diffuse);    specular.set(m.specular);    emissive.set(m.emissive);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?