/// <summary> /// /// </summary> /// <param name="model"></param> /// <returns></returns> public static PointsRenderer Create(Points model) { var shaderCodes = new ShaderCode[2]; shaderCodes[0] = new ShaderCode(ManifestResourceLoader.LoadTextFile(@"Resources\Points.vert"), ShaderType.VertexShader); shaderCodes[1] = new ShaderCode(ManifestResourceLoader.LoadTextFile(@"Resources\Points.frag"), ShaderType.FragmentShader); var map = new CSharpGL.AttributeMap(); map.Add("in_Position", Points.strposition); var renderer = new PointsRenderer(model, shaderCodes, map, Points.strposition); renderer.ModelSize = model.Lengths; renderer.WorldPosition = model.WorldPosition; renderer.stateList.Add(new PointSizeState(10)); return renderer; }
/// <summary> /// Rendering a evaluator(a bezier curve or surface) and its control points. /// </summary> /// <param name="controlPoints"></param> /// <param name="type"></param> /// <param name="model"></param> /// <param name="shaderCodes"></param> /// <param name="attributeMap"></param> /// <param name="positionNameInIBufferable"></param> /// <param name="switches"></param> private BezierRenderer(IList<vec3> controlPoints, BezierType type, Points model, CSharpGL.ShaderCode[] shaderCodes, CSharpGL.AttributeMap attributeMap, string positionNameInIBufferable, params GLState[] switches) : base(model, shaderCodes, attributeMap, positionNameInIBufferable, switches) { switch (type) { case BezierType.Curve: this.Evaluator = new Evaluator1DRenderer(controlPoints);//, lengths); break; case BezierType.Surface: this.Evaluator = new Evaluator2DRenderer(controlPoints);//, lengths); break; default: throw new System.NotImplementedException(); } }
/// <summary> /// /// </summary> /// <param name="model"></param> /// <param name="shaderCodes"></param> /// <param name="attributeMap"></param> /// <param name="positionNameInIBufferable"></param> /// <param name="switches"></param> public PointsRenderer(Points model, CSharpGL.ShaderCode[] shaderCodes, CSharpGL.AttributeMap attributeMap, string positionNameInIBufferable, params GLState[] switches) : base(model, shaderCodes, attributeMap, positionNameInIBufferable, switches) { }