コード例 #1
0
        /*
         * The  following code  renders a  body in  a  ludicrously inefficient
         * manner.  It iterates the materials and scans the data structure for
         * geometry using each.  This  has the effect of absolutely minimizing
         * material  changes,  texture  bindings,  and  Begin/End  pairs,  but
         * maximizing trips through the data.
         *
         * However, this  is only done once  for each level.   The results are
         * stored in display lists.  Thus, it is well worth it.
         */

        void sol_draw_geom(s_geom gp, int mi)
        {
            if (gp.m_mi == mi)
            {
                float[] ui = m_tv[gp.m_ti].m_u;
                float[] uj = m_tv[gp.m_tj].m_u;
                float[] uk = m_tv[gp.m_tk].m_u;

                float[] ni = m_sv[gp.m_si].m_n;
                float[] nj = m_sv[gp.m_sj].m_n;
                float[] nk = m_sv[gp.m_sk].m_n;

                float[] vi = m_vv[gp.m_vi].m_p;
                float[] vj = m_vv[gp.m_vj].m_p;
                float[] vk = m_vv[gp.m_vk].m_p;

                GL.TexCoord2(ui);
                GL.Normal3(ni);
                Video.Vertex3(vi);

                GL.TexCoord2(uj);
                GL.Normal3(nj);
                Video.Vertex3(vj);

                GL.TexCoord2(uk);
                GL.Normal3(nk);
                Video.Vertex3(vk);
            }
        }
コード例 #2
0
ファイル: Solid.cs プロジェクト: supeindesu/Neverball.NET
 public static void sol_load_geom(IntPtr fin, s_geom gp)
 {
     Binary.get_index(fin, ref gp.m_mi);
     Binary.get_index(fin, ref gp.m_ti);
     Binary.get_index(fin, ref gp.m_si);
     Binary.get_index(fin, ref gp.m_vi);
     Binary.get_index(fin, ref gp.m_tj);
     Binary.get_index(fin, ref gp.m_sj);
     Binary.get_index(fin, ref gp.m_vj);
     Binary.get_index(fin, ref gp.m_tk);
     Binary.get_index(fin, ref gp.m_sk);
     Binary.get_index(fin, ref gp.m_vk);
 }
コード例 #3
0
ファイル: s_body.cs プロジェクト: supeindesu/Neverball.NET
        void sol_shad_geom(s_file fp, s_geom gp, int mi)
        {
            if (gp.m_mi == mi)
            {
                float[] vi = fp.m_vv[gp.m_vi].m_p;
                float[] vj = fp.m_vv[gp.m_vj].m_p;
                float[] vk = fp.m_vv[gp.m_vk].m_p;

                Video.TexCoord2(vi[0], vi[2]);
                Video.Vertex3(vi);

                Video.TexCoord2(vj[0], vj[2]);
                Video.Vertex3(vj);

                Video.TexCoord2(vk[0], vk[2]);
                Video.Vertex3(vk);
            }
        }