Under Construction...

Lua version of Seumas-McNally's Particles is out.

The program uses SDL and Lua for Windows. Fading effect is implemented in C. Particle system and most animations are implemented in lua. Now the main scripts simulate the famous Seumas-McNally's screensaver lol:)

lua particles screenshot3

lua particles screenshot1

PS: Now my EMA-PHM project is finished, and I decided to wrote another script, aiming to illustrate the PF (Particle Filtering) algorithm, that means to render the probability of each particle, and to calculate and render the PDF (Probability Density Function) in real time. I must admit that this particle system is just for fun and I never thought of using it in my lab researches before, but now the system seems to be the perfect way of illustrating academical ideas, What a coincidence!

I hope the final work will help other students in the ATE lab, because many of them are using PF algorithm in their researches. Almost all other winform controls that I can find are way too ugly to do such a job.

Lua Serialization

This is a Lua table serializer.

Types of key can only be number or string, however values can be a table. Self reference (Loops) is supported.

function serialize(t)
    local parents={}
    local newbies={}
    local function genstring(tbl,parent)
        parents[tbl]=parent
        local t_tmp={}
        for e_key,e_value in pairs(tbl) do
            local key= type(e_key)=="number" and "["..e_key.."]" or e_key
            if type(e_value)=="table" then
                local cckey= parent..(type(e_key)=="number" and key or "."..key)
                if parents[e_value] then
                    table.insert(newbies,cckey.."="..parents[e_value])
                else
                    table.insert(t_tmp, key.."="..ser_table(e_value,cckey))
                end
            else
                table.insert(t_tmp, key.."="..e_value)
            end
        end
        return "{"..table.concat(t_tmp,",").."}"
    end
    return "do local ret="..genstring(t,"ret")..table.concat(newbies," ").." return ret end"
end

Dragon is powered by BlogCN.com - WordPress | BlogCN.com - WordPress Themes