Exemplo n.º 1
0
Arquivo: Mesh.cs Projeto: st1310/masgk
 public void Draw(ref Rasterizer rast, ref VertexProcessor proc)
 {
     for (int i = 0; i < Indices.Count; i += 3) //! make Indices.Count a variable
     {
         rast.Triangle(
             proc.Tr(Positions[Indices[i]]),
             proc.Tr(Positions[Indices[i + 1]]),
             proc.Tr(Positions[Indices[i + 2]]),
             (Float3)Color.Coral, (Float3)Color.Bisque, (Float3)Color.DarkCyan);
     }
 }
Exemplo n.º 2
0
Arquivo: Mesh.cs Projeto: st1310/masgk
 public void DrawUV(ref Rasterizer rast, ref VertexProcessor proc)
 {
     for (int i = 0; i < Indices.Count; i += 3) //! make Indices.Count a variable
     {
         rast.Triangle(
             proc.Tr(Positions[Indices[i]]),
             proc.Tr(Positions[Indices[i + 1]]),
             proc.Tr(Positions[Indices[i + 2]]),
             Light.Saturate(proc.Tr_obj2view3((TextureCoordinates[Indices[i]])) * 255f),
             Light.Saturate(proc.Tr_obj2view3((TextureCoordinates[Indices[i + 1]])) * 255f),
             Light.Saturate(proc.Tr_obj2view3((TextureCoordinates[Indices[i + 2]])) * 255f));
     }
 }
Exemplo n.º 3
0
Arquivo: Mesh.cs Projeto: st1310/masgk
 public void DrawNormals(ref Rasterizer rast, ref VertexProcessor proc)
 {
     for (int i = 0; i < Indices.Count; i += 3) //! make Indices.Count a variable
     {
         rast.Triangle(
             proc.Tr(Positions[Indices[i]]),
             proc.Tr(Positions[Indices[i + 1]]),
             proc.Tr(Positions[Indices[i + 2]]),
             Light.Saturate(proc.Tr_obj2view3((Normals[Indices[i]] + 1f) / 2f).Normalize * 255f),
             Light.Saturate(proc.Tr_obj2view3((Normals[Indices[i + 1]] + 1f) / 2f).Normalize * 255f),
             Light.Saturate(proc.Tr_obj2view3((Normals[Indices[i + 2]] + 1f) / 2f).Normalize * 255f));
     }
 }
Exemplo n.º 4
0
Arquivo: Mesh.cs Projeto: st1310/masgk
 public void DrawV(ref Rasterizer rast, ref VertexProcessor proc, ref Light light)
 {
     for (int i = 0; i < Indices.Count; i += 3) //! make Indices.Count a variable
     {
         rast.Triangle(
             proc.Tr(Positions[Indices[i]]),
             proc.Tr(Positions[Indices[i + 1]]),
             proc.Tr(Positions[Indices[i + 2]]),
             light.Calculate(Positions[Indices[i]], Normals[Indices[i]], ref proc),
             light.Calculate(Positions[Indices[i + 1]], Normals[Indices[i + 1]], ref proc),
             light.Calculate(Positions[Indices[i + 2]], Normals[Indices[i + 2]], ref proc));
     }
 }
Exemplo n.º 5
0
Arquivo: Mesh.cs Projeto: st1310/masgk
        public void DrawUV(ref Rasterizer rast, ref VertexProcessor proc, ref Light light, ref Buffer tex)
        {
            int count = Indices.Count;

            for (int i = 0; i < count; i += 3) //! make Indices.Count a variable
            {
                rast.Triangle(
                    proc.Tr(Positions[Indices[i]]),
                    proc.Tr(Positions[Indices[i + 1]]),
                    proc.Tr(Positions[Indices[i + 2]]),
                    Normals[Indices[i]],
                    Normals[Indices[i + 1]],
                    Normals[Indices[i + 2]],
                    TextureCoordinates[Indices[i]],
                    TextureCoordinates[Indices[i + 1]],
                    TextureCoordinates[Indices[i + 2]],
                    ref light,
                    ref proc,
                    ref tex);
            }
        }