当前位置: 首页>>代码示例>>C#>>正文


C# Plane.getDotValue方法代码示例

本文整理汇总了C#中Plane.getDotValue方法的典型用法代码示例。如果您正苦于以下问题:C# Plane.getDotValue方法的具体用法?C# Plane.getDotValue怎么用?C# Plane.getDotValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Plane的用法示例。


在下文中一共展示了Plane.getDotValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: cullLine

        private List<Vertex> cullLine(Vertex p1, Vertex p2, Plane p)
        {
            //List<Vertex> list = getPreCullList(p1, p2, p);
            //if (list != null)
            //    return list;

            List<Vertex> list = new List<Vertex>();
            float value1 = p.getDotValue(p1.pos);
            float value2 = p.getDotValue(p2.pos);

            float temp = value1 * value2;
            if (temp >= 0)
            {
                if (value1>0 && value2 > 0)
                {
                    list.Add(p1);
                    list.Add(p2);
                }
                else if (value1>0 && value2==0 || value2>0 && value1==0)
                {
                    list.Add(p1);
                    list.Add(p2);
                }
            }
            else
            {
                Vertex v = p.getInsertValue(p1, p2);
                if (value1 > 0)
                {
                    list.Add(p1);
                    list.Add(v);
                }
                else
                {
                    list.Add(v);
                    list.Add(p2);
                }
            }

            CullLine cullLine = new CullLine();
            cullLine.inputList.Add(p1);
            cullLine.inputList.Add(p2);
            cullLine.plane = p;
            cullLine.outPutList = list;
            string cacheString = p1.pos.ToString() + p2.pos.ToString() + p.normal.ToString()+p.point.ToString();
            cullLineList[cacheString] = cullLine;

            return list;
        }
开发者ID:ssjjsj,项目名称:softRender,代码行数:49,代码来源:Culler.cs


注:本文中的Plane.getDotValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。