Example #1
0
 /// <summary>
 /// 3D坐标系
 ///
 /// </summary>
 /// <param name="partCount"></param>
 /// <param name="radius"></param>
 public Axis(int partCount = 24, float radius = 1.0f)
 {
     if (partCount < 2)
     {
         throw new ArgumentException();
     }
     this.model = new AxisModel(partCount, radius);
 }
Example #2
0
 /// <summary>
 /// an 3D axis
 /// </summary>
 /// <param name="partCount"></param>
 /// <param name="radius"></param>
 public Axis(int partCount = 24, float radius = 0.5f)
 {
     if (partCount < 2)
     {
         throw new ArgumentException();
     }
     this.model     = new AxisModel(partCount, radius);
     this.ModelSize = new vec3(radius * 2, radius * 2, radius * 2);
 }
Example #3
0
        public static AxisNode Create()
        {
            // vertex buffer and index buffer.
            var model = new AxisModel();
            // vertex shader and fragment shader.
            var vs    = new VertexShader(vertexCode);
            var fs    = new FragmentShader(fragmentCode);
            var array = new ShaderArray(vs, fs);
            // which vertex buffer maps to which attribute in shader.
            var map = new AttributeMap();

            map.Add("inPosition", AxisModel.strPosition);
            map.Add("inColor", AxisModel.strColor);
            // build a render method.
            var builder = new RenderMethodBuilder(array, map, new LineWidthSwitch(3));
            // create node.
            var node = new AxisNode(model, builder);

            // initialize node.
            node.Initialize();

            return(node);
        }
Example #4
0
 public Axis(uint partCount = 24, float radius = 1.0f)
 {
     this.model = new AxisModel(partCount, radius);
 }
Example #5
0
 /// <summary>
 /// an 3D axis
 /// </summary>
 /// <param name="partCount"></param>
 /// <param name="radius"></param>
 public Axis(int partCount = 24, float radius = 0.5f)
 {
     if (partCount < 2) { throw new ArgumentException(); }
     this.model = new AxisModel(partCount, radius);
     this.ModelSize = new vec3(radius * 2, radius * 2, radius * 2);
 }