Lina's Blog
Flow3D OSX Port Progress
Over the past few weeks the Flow3D Mac port has slowly started to take shape; I’ve had to learn some Objective-C in the process, but it’s been rather easy so far.
Flow3D is at the point now where it compiles well as a dynamic library under XCode, and now it’s just a matter of getting native OSX window functionality working as well as it does in Windows. Now that the boring stuff is out of the way, have a screenshot!
I’ll report back when the Mac port is a little closer to beta testing phase. Also keep your eyes out for a Flow3D maintenance release this weekend!
Have Fun!
Lina
Flow3D Technical Lead
The Fluffy Shadow
Today will just be a quick update that expresses a few key additions to the Flow3D package as of late:
We have recently updated the Ogre3D rendering engine in Flow3D to use the latest production version, 1.6.0 (Shoggoth)! With this comes things like better script compiling and more effective memory allocation, amongst other things.
Along with the Ogre engine update, we have gotten some soft (texture) shadow demos working and simplified the implementation a bit with fG. With properly setup .material files to allow the shadows to be received, all you must call to get nice, soft shadows is this:
fG.enableSoftShadows() |
Ah, fluffy shadows, the 16,720th wonder of the world.
On to physics! We will be updating to Newton 2 within the next few days, so make sure to look out for a few videos within the week! While the update to Newton 2 is not yet complete, we have added simple ball/socket joint creation in fP with a small demo to go along with it. Have another screen shot!
The code for creating a basic Ball-Socket joint works a bit like this (taken from the demo):
'Create the socket from Socket.mesh Local Socket:TEntity = fG.LoadMesh("Socket" , "Socket.mesh") fG.PositionEntity(Socket, 0, 2, 0) fG.getNode(Socket).Roll(90) Local SocketBody:TBody = fP.addPhysics(Socket) 'Create the ball from Ball.mesh Local Ball:TEntity = fG.LoadMesh("Ball" + String(i), "Ball.mesh") fG.getNode(Ball).Roll(- 90) fG.PositionEntity(Ball, 0, 2, 0) Local BallBody:TBody = fP.addPhysics(Ball) 'Create the socket joint specifying the parent and the child. 'By using the defaults here we ensure that the joint bodies won't collide with one another. 'We also ensure that the joints position is the midway point betweent he two bodies' positions. Local joint:TBallAndSocket = fP.addBallSocket(SocketBody, BallBody) 'Here we set the rotation limits of the joint by specifying the direction of the joint pin. 'We also allow 80 degrees of "swing" space and 45 degrees of "twist" space in the joint. joint.setLimits(Vec3(1.0, 0.0, 0.0) , Radians(Deg2Rad(80)) , Radians(Deg2Rad(45))) |
And there you have it!
Get those ragdolls crackin’!
I hope you’ve enjoyed this preview!,
Lina
Today in Flow3D development: Particles!
Note: The code types specified in the code boxes is not correct.
BlitzBasic was just the most syntactically accurate highlighting scheme available at the moment.
Hey there! I’ve been busy at work with Flow3D all day today, as the Flow3D demo release is coming up and we all want to make sure there are no documentation and implementation holes. Today I spent a lot of the day tightening up the basic Particle System handling and I thought I’d give you a little preview of how particles work in Ogre and thus in Flow3D!
First off, the most common way to handle particle systems in Ogre is to use a template file, which can hold multiple particle system definitions. Template files look a little something like this:
File: Spark.particle Spark { quota 50 material PE/lensflare particle_width .5 particle_height 7 cull_each true renderer billboard billboard_type oriented_self emitter Point { angle 99 colour 1 1 0.821918 1 colour_range_start 1 1 0.821918 1 colour_range_end 1 1 0.821918 1 direction 0 1 0 emission_rate 50 position 0 0 0 velocity 30 velocity_min 30 velocity_max 70 time_to_live 0.3 time_to_live_min 0.3 time_to_live_max 0.3 duration 0.3 duration_min 0.3 duration_max 0.3 } affector LinearForce { force_vector 0 -100 0 force_application add } } |
And whew, that was a mouthful.
And while it seems that that would be painfully difficult to type by hand, if you check the Tools section of our site you’ll find plenty of Ogre particle generator tools out there - most of which are excellent for getting the effects you want. In fact, Spark.particle was generated with such a tool.
To load Spark.particle in Flow3D using fG is relatively painless. First you make sure that the .particle file as well as the material (PE/lensflare) that it references are in a resource directory that Ogre can get to, and then you simply call:
Global ps:TParticleSystem = fG.loadParticleSystem("myParticleSystem" , "Spark") fG.PositionEntity( ps , 0 , 50 , 0 ) |
The code above will create a spark particle system, and then set it to (0, 50 ,0) in world space.
I could have left off all of the positioning information, but it is rather unlikely that you are going to want to create a particle system at (0,0,0) all the time.
Now let’s discuss a few of the things I added in today. That is, let’s discuss manually spawning in particles from a blank particle system that we have created using fG. The code below is the full code, which compiles and runs on a BlitzMax install that has the flow.main module installed.
Import flow.main fG.init() 'Create our empty particle system and give it a mask texture Global ps:TParticleSystem = fG.createEmptyParticleSystem("ps") ps.setMaterialName("jet") 'Call to renderWorld to init the created particle system fG.renderWorld() 'Spawn four particles in a cross shape 'fG.createParticle( TParticleSystem , Direction , Size ) fG.createParticle(ps, Vec3(0, 100, 0) , 75.0) fG.createParticle(ps, Vec3(0, - 100, 0) , 75.0) fG.createParticle(ps, Vec3(- 100, 0, 0) , 75.0) fG.createParticle(ps, Vec3(100, 0, 0) , 75.0) 'Basic renderloop Repeat fG.renderWorld() Delay 1 / 60 Until KeyDown(KEY_ESCAPE) Or fG.appTerminated() |
The basic visual generated by the code is below:

While the render loop is a bit crude, the application successfully spawns four particles which spread across the screen in four directions. It is fair to say that if you find that the params for setting position, direction and velocity are not enough with createParticle(…), createParticle(…) also returns the TParticle that was created, which you can manipulate like so:
Global p:TParticle = fG.createParticle(ps, TVector3.Create(100, 0, 0) , 75.0) p.setTimeToLive(2.0) |
Anyways, that’s all the time I have for now! I hope this has been of some interest to you!
Lina
The FlowEd Beta and How It’s Going
While we haven’t paraded the release date everywhere, we’re hoping to release the FlowEd beta sometime this weekend ( December 12-14, 2008 ). Slowly, we’ve worked our way down the checklist of features and issues until it was empty, and now we’re primarily in the internal testing phase. After release, you’ll be able to test out FlowEd for yourself and any feedback you can provide will be greatly appreciated. The fastest way to give the team feedback will be to post in the FlowEd -> Issues and Requests forum so that we can itemize desired features and catalog the issues users encounter.
I will keep this post short and sweet - so I leave you with a random sceenshot of the current FlowEd SVN build. A little smoke on the water never hurt anyone. Well, yes it has, but you get the idea.

“Do crab cars have steering wheels on the side?”
-Lina


