Sub Jpct_SurfaceChanged(Width As Int, Height As Int)
Cube.RotateX(10) 'MY CODE
' set our framebuffer. pass a gl context, width and height
'fb.Initialize1(glsv.glContext.pContext, glsv.Width, glsv.Height)
FrameBuffer.Initialize1(Jpct.glContext, Width, Height)
' Initialize the world and lighting it
World.Initialize
World.setAmbientLight(20, 20, 20)
' Primitives -> Mesh
Cube.Initialize3(Primitives.getCube(10))
Cube.calcTextureWrapSpherical
' give or model a look with texture
' notice we used the name we gave
' from the TextureManager.
Cube.Texture = "cubetexture"
' clean the mesh
Cube.strip
' build it for our world
Cube.build
'add it to the wrld
World.addObject(Cube)
'now we deal with the camera
Camera.Initialize
' we assign the world's camera to our own camera
Camera= World.Camera
' movw the camera out 50 unit, and up 25 unit
Camera.moveCamera(Camera.CAMERA_MOVEOUT, 50)
Camera.moveCamera(Camera.CAMERA_MOVEUP,25)
' let the camera look at our cube's center
Camera.lookAt(Cube.TransformedCenter)
' we need to get the position of the model
' so we can place the Sun above it 100 unit
' away.
Vectore.Initialize4(Cube.TransformedCenter)
Vectore.y = -100
Vectore.z = -100
' now we Initialize a sun and set it above our model
' set the sun's rgb Intensity to 100.
Sun.Initialize(World)
Sun.Position = Vectore
Sun.setIntensity2(100, 100, 100)
' clean any unused/un-needed memory
MemHelper.compact
'hide the dialog.
ProgressDialogHide
End Sub