playing with gles11

Community Forums/Monkey Talk/playing with gles11

bruZard(Posted 2011) [#1]


Source for this image:
Strict

Import mojo
Import s3d.s3d

Class S3DTest Extends App
	Field plane:Mesh
	Field cam:Camera
	
	Method OnCreate:Int()
		InitS3D()
		
		plane = LoadMesh("mesh.txt")
		PositionEntity(plane, 0.0, 0.0, -2.0)
		EntityColor(plane, 255, 200, 0, 255)
				
		cam = CreateCamera()
		CameraClsColor(cam, 90, 120, 220)
				
		SetUpdateRate(60)
		
		Return 0
	End
	
	Method OnUpdate:Int()
		TurnEntity(plane, 1.0, 1.0, 1.0)
		
		Return 0
	End
	
	Method OnRender:Int()
		RenderWorld()
		
		Return 0
	End
End

Function Main:Int()
	New S3DTest()
	Return 0
End


the module:
http://www.sedm.de/monkey/s3d/s3d.zip

it's just experimental and not useful. but now i understand opengl a little bit better and can enhance this module.

ps: this will not work for android. i've no idea whats going wrong but i think i can fix that


shinkiro1(Posted 2012) [#2]
awesome. keep going.


bruZard(Posted 2012) [#3]
a new version is available


changes:
01/01/2011 v0.1
added	: Color.toArray:Float[]()
added	: Color.toBuffer:Int(buffer:DataBuffer, address:Int)
added	: Color.toString:String()
added	: Vertex.toBuffer:Int(buffer:DataBuffer, address:Int)
added	: Entity.SetColor:Void(col:Color4F)
added	: Entity.SetColor:Void(col:String) can actually be white, black, red, green, blue, yellow, magenta, grey, lightgrey, darkgrey, orange or brown
added	: Entity.GetColor:Color4F()
added	: Color.New(col:Color4F)
added	: Color.New(col:String)
added	: Vector.toArray:Float[]()
added	: Light.New(number:Int = GL_LIGHT0, lightType:Int = LIGHT_DIRECTIONAL)
added	: S3D.CreateLight:Light(lightType:Int = LIGHT_DIRECTIONAL)
added	: CreateLight:Light(lightType:Int = LIGHT_DIRECTIONAL)
changed	: MeshFileFormat: the chunk "face" has now 7 values: x, y, z, r, g, b, a for a vertex, RGBA is optional
fixed	: Mesh.New(meshFile:String) not longer read indices to vertices
note	: Lights can be created but are currently ignored because there are no material functions in s3d
note	: if CreateLight() returns Null, there be more than 8 lights in your code
note	: a bug (or my fail) prevents that a mesh can have vertex colors


v0.1 Module : http://www.sedm.de/monkey/s3d/s3d.zip
v0.1 Example: http://www.sedm.de/monkey/s3d/s3dExample.zip

have fun :D


bruZard(Posted 2012) [#4]


we are on the way....

that's a Wavefront *.obj Model exported from Blender, running on GLFW target


slenkar(Posted 2012) [#5]
good progress


Dabhand(Posted 2012) [#6]
Cool! :)

Dabz


bruZard(Posted 2012) [#7]
this video shows 17 monkeys. 16 monkeys are just references and not real loaded meshes.

http://www.youtube.com/watch?v=3d2-7E_6A5c&feature=g-upl&context=G2748571AUAAAAAAAAAA

the source for this demo:



BlitzSupport(Posted 2012) [#8]
Nice!


Jason W.(Posted 2012) [#9]
Nice job!

I only saw the video because I could not install your apk on 4.0.3 Ice Cream Sandwich. I'm using a custom rom on my Vibrant called ICS Passion 10.6.

Jason


Jason W.(Posted 2012) [#10]
Ok, i was able to get your apk running on my phone.

I did the following:
1. I used root explorer to copy your apk to the \system\apps folder.
2. I rebooted my phone in recovery, and cleared the Dalvik Cache.
3. I rebooted phone again, and was able to run your apk just fine.


I only see one monkey head, and it looks great!!

Jason


bruZard(Posted 2012) [#11]
Restart!

S3D is now again at version 0.1. I've added the greatful code from the "Master of Desaster" Mark Sibly and enhanced the code like i can do.

The module : http://www.sedm.de/monkey/s3d/s3d.zip
The 17 Monkeys Example: http://www.sedm.de/monkey/s3d/s3d17monkeys.zip

the demo doesn't work with GLFW, i've no idea why. I've just renamed the files so you not must edit your build config, and now it just will work on iOS and Android.

If you want to use custom models with S3D, here are some things you have to note:

1. the mesh must have texture coordinates (unwrap your mesh!)
2. at now you can only load Wavefront Object (*.obj) models with S3D
3. export your model with texture coordinates, uv coordinates and triangulate it. For Blender 2.6x: select "Include Normals" and "Triangulate Faces" in the export options.

If you want to use Wavefront Objects directly, add "|*.obj|*mtl" to the CONFIG.TXT. Otherwise you have to rename the file extension to "txt"

The plan is now to create a full 3D Engine which is to use like Blitz3D. Next step is to implement AABB bounding boxes for simple collisions


Blitzplotter(Posted 2012) [#12]
@Jason W & bruZard, thanks for the info - might try it on my Ice Cream Sandwich soon


bruZard(Posted 2012) [#13]
The "Game" is over, now it is a project and i call it "S3D".

Today it is just a really small update:
added	: ScaleEntity:Void(entity:Entity, x:Float = 1.0, y:Float = 1.0, z:Float = 1.0)
changed	: Entities do not more ignore his scale factor
changed	: cleanup source
changed : source splitted


http://www.sedm.de/monkey/s3d/s3d.zip

the next big thing are real cameras. the whole scene must be transformed if you move or rotate the camera. Then the "ObjLoader" Class has to be extended for more flexibility, more then one texture layer und for so many things that i think this thing will never be ready :)
Animations are a big theme, i've atm no idea about animations with vertex buffer objects ... but i think thats just a hole to jump over that.
once again: excuse me for my bad english ;)