- mEffectImage = Image::New(EFFECT_IMAGE);
-
- Material baseMaterial = Material::New( "Material1" );
- Dali::MeshActor meshActor = MeshActor::New( CreateMesh(true, baseMaterial) );
- meshActor.SetScale( 100.0f );
- meshActor.SetParentOrigin( ParentOrigin::CENTER );
- meshActor.SetPosition(Vector3( -150.0f, 200.0f, 0.0f ));
- meshActor.SetAffectedByLighting( false );
- meshActor.SetName("MeshActor");
- mContentLayer.Add( meshActor );
-
- Material orchidMaterial = Material::New( "Material2" );
- orchidMaterial.SetDiffuseTexture(mEffectImage);
-
- Dali::MeshActor meshActor2 = MeshActor::New( CreateMesh(false, orchidMaterial) );
- meshActor2.SetScale( 100.0f );
- meshActor2.SetParentOrigin( ParentOrigin::CENTER );
- meshActor2.SetPosition(Vector3( -150.0f, 310.0f, 0.0f ));
- meshActor2.SetAffectedByLighting( false );
- meshActor2.SetName("MeshActor");
- mContentLayer.Add( meshActor2 );
+ Geometry meshGeometry = CreateMeshGeometry();
+
+ // Create a coloured mesh
+ Shader shaderColorMesh = Shader::New( VERTEX_COLOR_MESH, FRAGMENT_COLOR_MESH );
+ Renderer colorMeshRenderer = Renderer::New( meshGeometry, shaderColorMesh );
+
+ Actor colorMeshActor = Actor::New();
+ colorMeshActor.AddRenderer( colorMeshRenderer );
+ colorMeshActor.SetSize( 175.f,175.f, 175.f );
+ colorMeshActor.SetParentOrigin( ParentOrigin::CENTER );
+ colorMeshActor.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+ colorMeshActor.SetPosition(Vector3(0.0f, 50.0f, 0.0f));
+ colorMeshActor.SetOrientation( Degree(75.f), Vector3::XAXIS );
+ colorMeshActor.SetName("ColorMeshActor");
+
+ // Create a textured mesh
+ Texture effectTexture = DemoHelper::LoadTexture(EFFECT_IMAGE);
+ Shader shaderTextureMesh = Shader::New( VERTEX_TEXTURE_MESH, FRAGMENT_TEXTURE_MESH );
+ TextureSet textureSet = TextureSet::New();
+ textureSet.SetTexture( 0u, effectTexture );
+ Renderer textureMeshRenderer = Renderer::New( meshGeometry, shaderTextureMesh );
+ textureMeshRenderer.SetTextures( textureSet );
+
+ Actor textureMeshActor = Actor::New();
+ textureMeshActor.AddRenderer( textureMeshRenderer );
+ textureMeshActor.SetSize( 175.f,175.f, 175.f );
+ textureMeshActor.SetParentOrigin( ParentOrigin::CENTER );
+ textureMeshActor.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+ textureMeshActor.SetPosition(Vector3(0.0f, 200.0f, 0.0f));
+ textureMeshActor.SetOrientation( Degree(75.f), Vector3::XAXIS );
+ textureMeshActor.SetName("TextureMeshActor");
+
+ Layer layer3d = Layer::New();
+ layer3d.SetParentOrigin( ParentOrigin::CENTER );
+ layer3d.SetAnchorPoint( AnchorPoint::CENTER );
+ layer3d.SetBehavior(Layer::LAYER_3D);
+
+ layer3d.Add( colorMeshActor );
+ layer3d.Add( textureMeshActor );
+ parentActor.Add(layer3d);