AppleLib is going to have one more content: SceneKit, Apples 3D game engine.
I will publish it the next days to the mac part of the library and later add the iOS control too.
Again, it would be great to have some testers and feedback, because the framework is simply to big to explore it alone.
No reason to reply here, because it will be on the free repository soon anyway, but as I dont receive much feedback on the libraries and enhancing Xojos game capabilities is somewhat of a topic to me, I though Id post an extra invitation here.
There will inevitably be a lot of bugs in there first, but as an appetizer: The code for the demo below is only
// Create the scene
dim scene as new AppleSCNScene
me.AppleObject.Scene = scene
me.AppleObject.AutoenablesDefaultLighting = true
me.AppleObject.ShowsStatistics = true
// create a box as origin for the logos
dim boxGeometry as new AppleSCNBox(10,10,10,1.0)
dim boxnode as new AppleSCNNode(boxGeometry)
boxnode.CategoryBitMask = 1
dim pbody as AppleSCNPhysicsBody = AppleSCNPhysicsBody.DynamicBody
boxnode.PhysicsBody = pbody
scene.RootNode.AddChildNode(boxnode)
me.AppleObject.AllowsCameraControl = true
boxnode.name = "boxnode"
// 2 lightsources
dim ambientnode as new AppleSCNNode
ambientnode.Light = new AppleSCNLight
ambientnode.Light.Type = AppleSCNLight.SCNLightType.Ambient
ambientnode.Light.LightColor = AppleColor.FromColor (&c22ff9922)
scene.RootNode.AddChildNode ambientnode
dim omniLightNode as new AppleSCNNode
omniLightNode.light =new AppleSCNLight
omniLightNode.light.type = AppleSCNLight.SCNLightType.Omni
omniLightNode.light.lightcolor = new applecolor(&cCD226600)
omniLightNode.position = SCNVector3Make(0, 50, 50)
scene.rootNode.addChildNode(omniLightNode)
dim logoimg as new AppleImage (OSXLibLogo)
// the logo as background
scene.Background.Contents = logoimg
// Floor
dim floor as new AppleSCNFloor
dim floornode as new AppleSCNNode(floor)
floornode.CreatePhysicsBody(AppleSCNPhysicsBody.SCNPhysicsBodyType.DynamicType)
floornode.PhysicsBody.CategoryBitMask = 2
floornode.PhysicsBody.CollisionBitMask = 3
floor.Reflectivity = 0.4
scene.RootNode.AddChildNode (floornode)
boxnode.PhysicsBody.CategoryBitMask = 1
boxnode.PhysicsBody.CollisionBitMask = 3
boxnode.PhysicsBody.AffectedByGravity = false
// Textnode
dim scntext as new AppleSCNText("SceneKit for Xojo-AppleLib", 2)
dim textnode as new AppleSCNNode(scntext)
scntext.Flatness = 0.1
scntext.FirstMaterial.Shininess = 0.9
boxnode.AddChildNode textnode
scntext.ExtrusionDepth = 20
scntext.ChamferRadius = 5
scene.FogStartDistance = 100
scene.FogEndDistance = 200
scene.FogColor = new applecolor (&c2433C400)
scene.FogDensityExponent = 1
boxnode.Geometry.FirstMaterial.Normal.Contents =logoimg
// Emitter, most of the code is for randomizing the parameters
dim emitter as new AppleSCNParticleSystem
emitter.BirthRate = 150
emitter.BirthRateVariation = 250
emitter.BirthDirection = AppleSCNParticleSystem.SCNParticleBirthDirection.RandomDirection
emitter.ParticleVelocity = 80
emitter.ParticleVelocityVariation = 80
emitter.ParticleAngularVelocityVariation = 270
emitter.ParticleAngleVariation = 180
emitter.ParticleLifeSpan = 50
emitter.ParticleLifeSpanVariation = 48
emitter.ParticleSizeVariation = 5
emitter.AffectedByGravity = true
emitter.ParticleImage = logoimg
emitter.ParticleColorVariation = SCNVector4Make(1, 1,1,1)
emitter.LightingEnabled = true
boxnode.AddParticleSystem (emitter)