Damien's Blog
Dynamic mesh creation
Well, the past couple of days I was supposed to be updating FlowED- however, things don’t always go to plan. Instead I found myself looking at mesh generation.
From the bog standard ManualObject demo I churned out a plethora of functions that draw and texture shapes using pixel coordinates, similar to how Max2D works. Emulating Max2D in Ogre probably isn’t going to be 1:1 because of the differences between the systems, but we’ll get close, and it will still of course be easy. Functions I wrote and tested were:
fG.Init2D()
fG.SetMaterial(Material:String)
fG.DrawRect(xPos:int,yPos:int,Width:int,Height:int,fill:int=false)
fG.DrawOval(xPos:int,yPos:int,width:int,height:int,edges:int,Fill:int=false)
fG.DrawLine()
I had fun writing these small functions and wrote a little example so if the interface is agreed upon, it may just see the next release.
The next thing this bought up was 3D mesh creation. To start with, I tasked myself with creating an easy CreateTerrain function. What I came up with was a CreateTerrain function that takes a 2 dimensional array containing the heightmap, and spits out a textured terrain with the same dimensions as the array.
The result was quite tasty, and I’m pretty sure this is what I’m going to use to create a slightly more realistic water demo- something I’ve wanted to do for a long time- you can expect more on this in the future.
The next step will be implementing the CreateMesh, Addvertex, Addtriangle, vertexnormals etc. These are the juicy bits- These alongside dynamic materials mean we could be generating some mean looking landscapes in code….
If you have any ideas or requests with this stuff- drop it in the forums where we can give it the old once over.
Over and out,
Damien.
More FlowED Physics
Yes, I just wanted to show off more physics in FlowED. I didn’t count the amount of cubes, but its pretty nice watching it all fall when being hit by a Mini!
Here’s a quick video showing the improvements in performance since yesterdays video.
Physics in FlowED
Yes, aha! I’ve managet to get physics working realtime in FlowED. This proved quite an easy task since the editor had been quite streamlined over the past few months.
It’s using Newton Game Dynamics 2 and the latest Flow. and will be released with the next Flow Beta.
Here’s a video of me fiddling around with it very shortly after first getting it running.
Fun with robots, huge stacks, and guns.
Well, I’ve almost completed the small gameplay tutorial code now, it’s in the Flow3D SVN. Last night I took some time to add a couple of sounds and somewhere along the way I figured I’d see just how much of an improvement Newton Game Dynamics 2 is over its predecessor.
The video below is the result- with Newton Game Dynamics 1, my system - an Intel Core 2 Duo E8400 at 3ghz CPU with an Nvidia Geforce 8800 graphics chip, would struggle with 200 blocks, achieving a very stuttery 2-10fps. with Newton Game Dynamics 2, I managed 600! blocks at nearly 30fps- and in all honestly it seemed even smoother than that!
Note that stacking a wall the way I have done in this video really stresses Newton too, where if I was to simply stack the blocks in columns it would be even quicker!