Beispiel #1
0
        SceneContainer CreateScene()
        {
            // Initialize transform components that need to be changed inside "RenderAFrame"
            _baseTransform = new Transform
            {
                Rotation    = new float3(0, 0, 0),
                Scale       = new float3(1, 1, 1),
                Translation = new float3(0, 0, 0)
            };

            // Setup the scene graph
            return(new SceneContainer
            {
                Children = new List <SceneNode>
                {
                    new SceneNode
                    {
                        Components = new List <SceneComponent>
                        {
                            // TRANSFORM COMPONENT
                            _baseTransform,

                            // SHADER EFFECT COMPONENT
                            ShaderCodeBuilder.MakeShaderEffect(new float4(0.7f, 0.7f, 0.7f, 1)),

                            // MESH COMPONENT
                            SimpleMeshes.CreateCylinder(5, 10, 8)
                        }
                    },
                }
            });
        }
        SceneContainer CreateScene()
        {
            // Initialize transform components that need to be changed inside "RenderAFrame"
            _baseTransform = new Transform
            {
                Rotation    = new float3(0, 0, 0),
                Scale       = new float3(1, 1, 1),
                Translation = new float3(0, 0, 0)
            };

            // Setup the scene graph
            return(new SceneContainer
            {
                Children = new List <SceneNode>
                {
                    new SceneNode
                    {
                        Components = new List <SceneComponent>
                        {
                            // TRANSFORM COMPONENT
                            _baseTransform,

                            // SHADER EFFECT COMPONENT
                            SimpleMeshes.MakeMaterial((float4)ColorUint.LightSkyBlue),

                            // MESH COMPONENT
                            SimpleMeshes.CreateCylinder(5, 10, 18)
                        }
                    },
                }
            });
        }
        SceneContainer CreateScene()
        {
            // Initialize transform components that need to be changed inside "RenderAFrame"
            _baseTransform = new TransformComponent
            {
                Rotation    = new float3(0, 0, 0),
                Scale       = new float3(1, 1, 1),
                Translation = new float3(0, 0, 0)
            };

            // Setup the scene graph
            return(new SceneContainer
            {
                Children = new List <SceneNodeContainer>
                {
                    new SceneNodeContainer
                    {
                        Components = new List <SceneComponentContainer>
                        {
                            // TRANSFROM COMPONENT
                            _baseTransform,

                            // SHADER EFFECT COMPONENT
                            new ShaderEffectComponent
                            {
                                Effect = SimpleMeshes.MakeShaderEffect(new float3(0.7f, 0.7f, 0.7f), new float3(1, 1, 1), 5)
                            },

                            // MESH COMPONENT
                            SimpleMeshes.CreateCylinder(8, 8, 20)
                        }
                    },
                }
            });
        }