Click here to Skip to main content
15,896,421 members
Articles / Programming Languages / C#

Simple Ray Tracing in C# Part VI (Vertex Normal Interpolation)

Rate me:
Please Sign up or sign in to vote.
4.75/5 (26 votes)
15 Jul 2016GPL33 min read 62.1K   5.1K   70  
An approach to interpolate vertex normals on triangles
using System;
using System.Collections.Generic;
using System.Text;

namespace RayTracer
{
    public class Material
    {
        public double ambientR, ambientG, ambientB, ambientA;
        public double diffuseR, diffuseG, diffuseB, diffuseA;
        public double specularR, specularG, specularB, specularA;
        public double emissionR, emissionG, emissionB, emissionA;
        public double shininess;
        public double reflectance;
        public double alpha;
        public string sName;
        public double refractionIndex;

        public Material(string sName, double alpha, double reflectance,
            double ambientR, double ambientG, double ambientB,
            double specularR, double specularG, double specularB,
            double shininess,
            double diffuseR, double diffuseG, double diffuseB, double refractionindex)
        {
            this.alpha = alpha;
            this.reflectance = reflectance;
            this.ambientR = ambientR;
            this.ambientG = ambientG;
            this.ambientB = ambientB;
            this.specularR = specularR;
            this.specularG = specularG;
            this.specularB = specularB;
            this.shininess = shininess;
            this.diffuseR = diffuseR;
            this.diffuseG = diffuseG;
            this.diffuseB = diffuseB;
            this.sName = sName;
            this.refractionIndex = refractionindex;
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
CEO
Brazil Brazil
"A well written code is self explanatory" - Anonymous Programmer
"The number of meetings is directly proportional to the bad management" - Another Anonymous Programmer
Founder @TIHUNTER.COM.BR
Linkedin Profile

Comments and Discussions