Ejemplo n.º 1
0
        private SceneNodeBase GetRootNode()
        {
            var rootNode = new GroupNode();

            {
                var node = CameraNode.Create();
                node.Scale = new vec3(1, 1, 1) * 0.2f;
                rootNode.Children.Add(node);
            }
            {
                var node = CubeNode.Create();
                node.WorldPosition = new vec3(0, 0, -3.5f);
                node.RotationAxis  = new vec3(1, 1, 1);
                node.RotationAngle = 17;

                rootNode.Children.Add(node);
            }
            {
                var node = RectNode.Create();
                node.WorldPosition = new vec3(0, 0, -0.5f);
                node.Scale         = new vec3(1, 1, 1) * 2;

                rootNode.Children.Add(node);
            }
            {
                var node = LineNode.Create(new vec3(0, 0, -6));
                rootNode.Children.Add(node);
            }
            {
                var groundNode = GroundNode.Create();
                //rootNode.Children.Add(groundNode);
            }

            return(rootNode);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Render propeller in modern opengl.
        /// </summary>
        /// <returns></returns>
        public static RectNode Create()
        {
            var vs       = new VertexShader(vertexCode);
            var fs       = new FragmentShader(fragmentCode);
            var provider = new ShaderArray(vs, fs);
            var map      = new AttributeMap();

            map.Add(inPosition, RectModel.strPosition);
            var builder = new RenderMethodBuilder(provider, map);
            var node    = new RectNode(new RectModel(), RectModel.strPosition, builder);

            node.Initialize();

            return(node);
        }