In this recipe we are going to implement the "Hello World" equivalent of the 3D graphics world. We will be creating a fully textured 3D crate, the most famous textured cube known to mankind.
Load PlayStation Mobile Studio and create a new project. Additionally, you will need a create texture map. I downloaded this texture from the site www.OpenGameArt.org. You can download this particular texture at http://bit.ly/TuKCo. You can download the complete project including images as Ch7_Example2
.
Open
AppMain.cs
and replace its contents with the following code:using System; using Sce.PlayStation.Core; using Sce.PlayStation.Core.Graphics; using Sce.PlayStation.Core.Input; namespace Ch7_Example2 { public class AppMain { public static VertexBuffer MakeCube() { VertexBuffer vertexBuffer = new VertexBuffer(24, 36, VertexFormat.Float3, VertexFormat.Float2); float[] positions = { -0.5f, 0.5f, -0.5f, -0.5f, 0.5f, 0...