Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Jim Bauwens

Pages: 1 [2] 3 4
16
Lua / Chipmunk Physics
« on: July 26, 2012, 03:59:10 pm »
Hi all.

3.2 integrates the Chipmunk physics engine with Lua bindings. This allows us create fun games with the physics.
However there is just one problem. It's pretty complex.
So here is some useful info if you want to start programming.

1. The API documentation for 3.2
Download it at http://education.ti.com/nspire/scripting-api .
It's a must have in order to find all the API function names (duh :P )

2. The online chipmunk docs
http://chipmunk-physics.net/release/Chipmunk-5.x/Chipmunk-5.3.4-Docs/
Even though it describes the C API, it shows how the concepts of the engine and how it's structured.
And most Lua functions have similar names to the C ones.
You will find yourself checking this resource often when you start programming with the engine ;)

3. A tutorial (although for the C API)
http://www.alexandre-gomes.com/articles/chipmunk/
This tutorial helps you understand the concepts and inner workings of the physics engine.

4. Example code (by me)
Spoiler For Basic start:


platform.apilevel = '2.0'
require 'physics'


LARGE=physics.misc.INFINITY()
ZERO =physics.Vect(0,0)
------------------
-- Space Object --
------------------

pSpace   = class()

function pSpace:init(gravity)
   self.space = physics.Space()
         :setGravity(physics.Vect(0, gravity))
         :setSleepTimeThreshold(.5)
         
   self.objects   = {}
end

function pSpace:step(n)
   self.space:step(n)
end

function pSpace:addObj(obj, x, y)
   obj.body:setPos(physics.Vect(x, y))
   self.space:addBody(obj.body)
   
   self.space:addShape(obj.shape)
   if obj.added then obj:added(self) end
   
   table.insert(self.objects, obj)
   return self
end

function pSpace:addTerrainObj(obj, x, y)
   obj.body:setPos(physics.Vect(x, y))
   --self.space:addBody(obj.body)
   
   for _, ss in ipairs(obj.segments) do
      self.space:addStaticShape(ss)
   end
   
   table.insert(self.objects, obj)
   return self
end

function pSpace:addStaticObj(obj, x, y)
   obj.body:setPos(physics.Vect(x, y))
   --self.space:addBody(obj.body)
   self.space:addStaticShape(obj.shape)
   
   table.insert(self.objects, obj)
   return self
end

function pSpace:paint(gc)
   for _, obj in ipairs(self.objects) do
      obj:paint(gc)
   end
end

----------------
-- Box Object --
----------------

pBox   = class()

function pBox:init(w,h,mass,color)
   self.h=h
   self.w=w
   self.mass=mass
   self.color=color
   
   self.verts = {
      physics.Vect(-w/2, -h/2),
      physics.Vect(-w/2,  h/2),
      physics.Vect(w/2 ,  h/2),
      physics.Vect(w/2 , -h/2)
   } 
   
   self.body   = physics.Body(1, 1)
   self.body:setMass(mass)
   self.body:setMoment(physics.misc.momentForPoly(mass, self.verts, ZERO))
   self.body:setVel(ZERO)
   
   self.shape = physics.PolyShape(self.body, self.verts, ZERO)

   self.shape:setRestitution(0.6)
   self.shape:setFriction(0.6)
end

function pBox:paint(gc)
   local coords   = self.shape:points()
   local polycoords   = {}
   for k, vert in ipairs(coords) do
      table.insert(polycoords, vert:x())
      table.insert(polycoords, vert:y())
   end   
   local x,y=coords[1]:x(),coords[1]:y()
   table.insert(polycoords, x)
   table.insert(polycoords, y)           

   gc:setColorRGB(self.color)
   gc:fillPolygon(polycoords)
   gc:setColorRGB(0,0,0)
   gc:drawPolyLine(polycoords)
end


-----------------
-- Ball Object --
-----------------

pBall   = class()

function pBall:init(r,mass,color)
   self.r=r
   self.mass=mass
   self.color=color
   
   self.body   = physics.Body(1, 1)
   self.body:setMass(mass)
   self.body:setMoment(physics.misc.momentForCircle(mass, 0, r, ZERO))
   self.body:setVel(ZERO)
   
   self.shape = physics.CircleShape(self.body, r, ZERO)

   self.shape:setRestitution(0.6)
   self.shape:setFriction(0.6)
   --[[
   self.segment = physics.SegmentShape(self.body, physics.Vect(0,-r), physics.Vect(0,0), 1)
    self.segment:setRestitution(0)
   self.segment:setFriction(0)
   --]]
end

function pBall:added(spaceObj)
   --spaceObj.space:addShape(self.segment)
end

function pBall:paint(gc)
   local pos=self.body:pos()
   local x, y = pos:x(), pos:y()
    local r = self.r
         
    gc:setColorRGB(self.color)                           
    gc:fillArc(x-r, y-r, 2*r+1, 2*r+1, 0, 360)
    gc:setColorRGB(0)
    gc:drawArc(x-r, y-r, 2*r, 2*r, 0, 360)
   
    local x2,y2
    local angle=self.body:angle()
    x2   = math.cos(angle)*self.r+x
    y2   = math.sin(angle)*self.r+y
    gc:drawLine(x,y,x2,y2)
end



------------------
-- Terrain code --
------------------

function getMidPoint(line)
    local xdif    = math.abs(line[3]-line[1])
    local ydif    = math.abs(line[4]-line[2])
    local x    = math.min(line[3], line[1]) + xdif/2
    local y    = math.min(line[4], line[2]) + ydif/2
    return x, y
end

function terrain(bline, range, roughness, tms)
    local lines    = {bline}
    local lines2    = {}

    local midX, midY

    for times=1, tms do
        for index, line in pairs(lines) do
            midX, midY    = getMidPoint(line)
            midY    = midY + math.random(-range, range)

            table.insert(lines2, {line[1], line[2], midX, midY})
            table.insert(lines2, {midX, midY, line[3], line[4]})
        end
        lines    = lines2
        lines2    = {}
        range    = range * (roughness*2^-roughness)
    end

    return lines
end

------------------------
-- Terrain to physics --
------------------------

pTerrain   = class()

function pTerrain:init(bline, range, roughness, times)
   self.lines    = terrain(bline, range, roughness, times)
   self.segments = {}

   self.mass   = LARGE
   self.body   = physics.Body(1, 1)
   self.body:setMass(self.mass)
   
   self.inertia   = 0
   
   local a, b, ss
   for index, line in ipairs(self.lines) do
        a   = physics.Vect(line[1], line[2])
        b   = physics.Vect(line[3], line[4])
       
        self.inertia   = self.inertia + physics.misc.momentForSegment(self.mass/#self.lines, a, b)
        ss   = physics.SegmentShape(self.body, a, b, 1)
        ss:setRestitution(0)
      ss:setFriction(1)
        table.insert(self.segments, ss)
    end

   self.body:setMoment(self.inertia)
   self.body:setVel(ZERO)
   
end

function pTerrain:paint(gc)
   local a,b
    for index, ss in ipairs(self.segments) do
      a = ss:a()
      b = ss:b()
        gc:drawLine(a:x(), a:y(), b:x(), b:y())
    end
end



function on.construction()
   space   = pSpace(9. 8)
   
   timer.start(0.01)
   count=0
   
   ter   = pTerrain({0,120,318,120}, 60, 0.6, 5)
   space:addTerrainObj(ter, 0,0)
   
   ball = pBall(10, 5, 0xaaffaa)
   space:addObj(ball, 160,10)
end


function physicsUpdate()
   space:step(0.1)

   count = count + 1
   if count == 2 then
      platform.window:invalidate()
      count = 1
   end   
end

py,px=100,160

function on.paint(gc)
   space:paint(gc)
   gc:fillRect(px, py, 4, 4)
end

kaction   = {up={0,-5}, down={0,5}, left={-5,0}, right={5,0}}
function on.arrowKey(key)
   px=px+kaction[1]
   py=py+kaction[2]
end

function on.enterKey()
   local box   = pBox(20, 20, 5, math.random(2^16))
   space:addObj(box, px, py)
end

function on.timer()
   physicsUpdate()
end


Spoiler For A bit more advanced (motors/springs/etc):


platform.apilevel = '2.0'
require 'physics'


LARGE=physics.misc.INFINITY()
ZERO =physics.Vect(0,0)
------------------
-- Space Object --
------------------

pSpace   = class()

function pSpace:init(gravity)
   self.space = physics.Space()
         :setGravity(physics.Vect(0, gravity))
         :setSleepTimeThreshold(.5)
         --:resizeActiveHash(30, 500)
   self.objects   = {}
end

function pSpace:step(n)
   self.space:step(n)
end

function pSpace:addObj(obj, x, y)
   obj.body:setPos(physics.Vect(x, y))
   self.space:addBody(obj.body)
   
   self.space:addShape(obj.shape)
   if obj.added then obj:added(self) end
   
   table.insert(self.objects, obj)
   return self
end

function pSpace:addTerrainObj(obj, x, y)
   obj.body:setPos(physics.Vect(x, y))
   --self.space:addBody(obj.body)
   
   for _, ss in ipairs(obj.segments) do
      self.space:addStaticShape(ss)
   end
   
   table.insert(self.objects, obj)
   return self
end

function pSpace:addStaticObj(obj, x, y)
   obj.body:setPos(physics.Vect(x, y))
   --self.space:addBody(obj.body)
   self.space:addStaticShape(obj.shape)
   
   table.insert(self.objects, obj)
   return self
end

function pSpace:addComplexObj(obj, x, y)
   for _, childObj in ipairs(obj.objects) do
      self:addObj(childObj.obj, x+childObj.x, y+childObj.y)
   end
   
   for _, constraint in ipairs(obj.constraints) do
      self.space:addConstraint(constraint)
   end   
   
   table.insert(self.objects, obj)
   return self   
end

function pSpace:paint(gc)
   for _, obj in ipairs(self.objects) do
      obj:paint(gc)
   end
end

----------------
-- Box Object --
----------------

pBox   = class()

function pBox:init(w, h, mass, color, f, e, group)
   self.h=h
   self.w=w
   self.mass=mass
   self.color=color
   
   self.verts = {
      physics.Vect(-w/2, -h/2),
      physics.Vect(-w/2,  h/2),
      physics.Vect(w/2 ,  h/2),
      physics.Vect(w/2 , -h/2)
   } 
   
   self.body   = physics.Body(1, 1)
   self.body:setMass(mass)
   self.body:setMoment(physics.misc.momentForPoly(mass, self.verts, ZERO))
   self.body:setVel(ZERO)
   
   self.shape = physics.PolyShape(self.body, self.verts, ZERO)

   self.shape:setRestitution(e or 0.6)
   self.shape:setFriction(f or 0.6)
   
   if group then self.shape:setGroup(group) end
end

function pBox:paint(gc)
   local coords   = self.shape:points()
   local polycoords   = {}
   for k, vert in ipairs(coords) do
      table.insert(polycoords, vert:x())
      table.insert(polycoords, vert:y())
   end   
   local x,y=coords[1]:x(),coords[1]:y()
   table.insert(polycoords, x)
   table.insert(polycoords, y)           

   gc:setColorRGB(self.color)
   gc:fillPolygon(polycoords)
   gc:setColorRGB(0,0,0)
   gc:drawPolyLine(polycoords)
end


-----------------
-- Ball Object --
-----------------

pBall   = class()

function pBall:init(r,mass,color, f, e, group)
   self.r=r
   self.mass=mass
   self.color=color
   
   self.body   = physics.Body(1, 1)
   self.body:setMass(mass)
   self.body:setMoment(physics.misc.momentForCircle(mass, 0, r, ZERO))
   self.body:setVel(ZERO)
   
   self.shape = physics.CircleShape(self.body, r, ZERO)

   self.shape:setRestitution(e or 0.6)
   self.shape:setFriction(f or 0.6)
   
   if group then self.shape:setGroup(group) end
end

function pBall:paint(gc)
   local pos=self.body:pos()
   local x, y = pos:x(), pos:y()
    local r = self.r
         
    gc:setColorRGB(self.color)                           
    gc:fillArc(x-r, y-r, 2*r+1, 2*r+1, 0, 360)
    gc:setColorRGB(0)
    gc:drawArc(x-r, y-r, 2*r, 2*r, 0, 360)
   
    local x2,y2
    local angle=self.body:angle()
    x2   = math.cos(angle)*self.r+x
    y2   = math.sin(angle)*self.r+y
    gc:drawLine(x,y,x2,y2)
end





pCar   = class()

function pCar:init()
   local group   = 5
   
   local wheelR   = 5   -- wheel Radius
   local wheelM   = 5   -- wheel Mass
   local wheelF   = 0.9   -- wheel Friction
   local wheelE   = 0.0   -- wheel Elasticity
   
   local chassisM   = 10   -- Chassis Mass
   local chassisW   = 24   -- Chassis Width
   local chassisH   = 10   -- Chassis Height
   local chassisF   = 0.7   -- Chassis Friction
   local chassisE   = 0.0   -- Chassis Elasticity
   
   self.wheel1   = pBall(wheelR, wheelM, 0x55CC55, wheelF, wheelE, group)
   self.wheel2   = pBall(wheelR, wheelM+8, 0x55CC55, wheelF, wheelE, group)
   
   self.chassis   = pBox(chassisW, chassisH, chassisM, 0x5555CC, chassisF, chassisE, group)
   
   self.joint1   = physics.GrooveJoint(self.chassis.body, self.wheel1.body, physics.Vect(-10, 5), physics.Vect(-10, 25), ZERO)
   self.joint2   = physics.GrooveJoint(self.chassis.body, self.wheel2.body, physics.Vect( 10, 5), physics.Vect( 10, 25), ZERO)
   
   self.spring1   = physics.DampedSpring(self.chassis.body, self.wheel1.body, physics.Vect(-10, 0), ZERO, 17, 10, 10)
   self.spring2   = physics.DampedSpring(self.chassis.body, self.wheel2.body, physics.Vect( 10, 0), ZERO, 17, 10, 10)
   
   self.Fmotor   = physics.SimpleMotor(self.chassis.body, self.wheel2.body, 0):setMaxForce(1000)
   self.Pmotor   = physics.SimpleMotor(self.chassis.body, self.wheel2.body, 0):setMaxForce(1000)
   self.gear   = physics.GearJoint(self.wheel1.body, self.wheel2.body, 0, 1)
   
   self.objects   = {
      {obj = self.wheel1 , x = -10 ,y = 7},
      {obj = self.wheel2 , x = 10  , y = 7},
      {obj = self.chassis, x = 0 ,y = -7},
   }
   
   self.constraints   = {self.joint1, self.joint2, self.spring1, self.spring2, self.Fmotor, self.Pmotor, self.gear}   
end

function pCar:paint(gc)
   self.wheel1:paint(gc)
   self.wheel2:paint(gc)
   self.chassis:paint(gc)
end






------------------
-- Terrain code --
------------------

function getMidPoint(line)
    local xdif    = math.abs(line[3]-line[1])
    local ydif    = math.abs(line[4]-line[2])
    local x    = math.min(line[3], line[1]) + xdif/2
    local y    = math.min(line[4], line[2]) + ydif/2
    return x, y
end

function terrain(bline, range, roughness, tms)
    local lines    = {bline}
    local lines2    = {}

    local midX, midY

    for times=1, tms do
        for index, line in pairs(lines) do
            midX, midY    = getMidPoint(line)
            midY    = midY + math.random(-range, range)

            table.insert(lines2, {line[1], line[2], midX, midY})
            table.insert(lines2, {midX, midY, line[3], line[4]})
        end
        lines    = lines2
        lines2    = {}
        range    = range * (roughness*2^-roughness)
    end

    return lines
end

------------------------
-- Terrain to physics --
------------------------

pTerrain   = class()

function pTerrain:init(bline, range, roughness, times)
   self.lines    = terrain(bline, range, roughness, times)
   self.segments = {}

   self.mass   = LARGE
   self.body   = physics.Body(1, 1)
   self.body:setMass(self.mass)
   
   self.inertia   = 0
   
   local a, b, ss
   for index, line in ipairs(self.lines) do
        a   = physics.Vect(line[1], line[2])
        b   = physics.Vect(line[3], line[4])
       
        self.inertia   = self.inertia + physics.misc.momentForSegment(self.mass/#self.lines, a, b)
        ss   = physics.SegmentShape(self.body, a, b, 1)
        ss:setRestitution(0)
      ss:setFriction(1)
        table.insert(self.segments, ss)
    end

   self.body:setMoment(self.inertia)
   self.body:setVel(ZERO)
   
end

function pTerrain:paint(gc)
   local a,b
    for index, ss in ipairs(self.segments) do
      a = ss:a()
      b = ss:b()
        gc:drawLine(a:x(), a:y(), b:x(), b:y())
    end
end













function on.construction()
   space   = pSpace(9. 8)
   
   timer.start(0.02)
   count=0
   
   --[[
   floor   = pBox(300, 20, LARGE, 0xCC5555, 0.9)
   space:addStaticObj(floor, 150, 200)
   --]]
   
   ter   = pTerrain({0,120,318,120}, 60, 0.6, 5)
   space:addTerrainObj(ter, 0,0)
   
   car   = pCar()
   space:addComplexObj(car, 50, 50)
end


function on.tabKey()
   car.Pmotor:setMaxForce(10000)
   car.Pmotor:setRate(car.Pmotor:rate()-0.3)
end

function on.escapeKey()
   car.Pmotor:setMaxForce(0)
   car.Pmotor:setRate(0)   
end

function physicsUpdate()
   space:step(0.1)

   count = count + 1
   if count == 2 then
      platform.window:invalidate()
      count = 1
   end   
end

py,px=100,160

function on.paint(gc)
   local f   = math.abs(car.Pmotor:rate())
   gc:drawString("Force: " .. f, 2, 2, "top")
   space:paint(gc)
   gc:fillRect(px, py, 4, 4)
end

kaction   = {up={0,-5}, down={0,5}, left={-5,0}, right={5,0}}
function on.arrowKey(key)
   px=px+kaction[1]
   py=py+kaction[2]
end

function on.enterKey()
   local box   = pBox(20, 20, 5, math.random(2^16))
   space:addObj(box, px, py)
end

function on.timer()
   physicsUpdate()
end


I spend some time making this code, so please take care of it  ;)

5. Take a look at other exisiting activities for the TI-Nspire that use the physics engine
http://education.ti.com/calculators/tisciencenspired/US/Activities/Detail?sa=5029&id=17888

And last but not least ...
Have fun !

17
TI-Nspire / Centipede: my not-finished-in-time entry for the contest
« on: July 09, 2012, 04:46:36 am »
About two weeks ago I decided I wanted to make a Centipede clone for the contest. Centipede is a classic Atari game.
Sadly enough I only could spend a couple of hours on it, so it did not get done in time.

Here is what I have until now:


As you can see there are still many things lacking:
- You don't die when hit (or win)
- No spiders, no fleas and no scorpions
- graphics aren't so good yet
- Controls need improvement.

But I intend to finish it, so it's not too bad :)

18
Lua / TI & Lua
« on: June 10, 2012, 07:04:47 am »
TI updated their scripting page a bit a couple of days ago:
http://education.ti.com/educationportal/sites/US/nonProductSingle/nspire-scripting.html

Some interesting statements:
Quote
For programmers and the programming community
The wider programming community gains a potential programming and gaming platform that can well suit their needs. We look forward to seeing programmers band together through existing online communities to share their work and learn from one another.

At least they recognize that there is/was a need. And because several members of the community have close contact with TI, stuff will only get better :)
Also, they clearly don't mind games ..

Quote
Getting started with Lua scripting for TI-Nspire technology
Try a series of tutorials that will take you from getting started to creating TI-Nspire documents with the Script Editor. Learn more

These tutorials use OcLua (made by ExtendeD)  ;D

Both things show that they slowly start appreciating the community again. This is because it benefits them too. (So if they would open up to native programming, it would benefit them a great deal). If TI continues with this trend I think we will see some great stuff happening :)


19
Lua / Lua and 3.2
« on: June 07, 2012, 03:15:24 am »
So, the new TI-Nspire OS 3.2 is out. What does that mean for Lua developers ?
Well, a lot ! There are some important changes that you all should know about, in order to make your applications works perfectly on 3.2.
TI has done a great job keeping compatibility, but there are some tiny stuff that might cause certain programs not to run (properly).


Compatibility mode
Let me first begin with the compatibility mode. TI has 2 "apiLevel's" in 3.2. apiLevel 1.0 provides backwards compatibility for <3.2 OS's by keeping the old API structure.
All documents created for 3.1 and previous will run in that apiLevel by default. This is because some changes in the XML structure of the document. So most programs and games should run fine by default.
Then there is apiLevel 2.0. This apiLevel has some big changes to the API structure, so you will have to update some of your code in order to have some of they new 3.2 stuff. However, it is currently not possible to create apiLevel 2.0 documents with Luna due to changes in the XML structure. I have given the details of the changes to ExtendeD so he will probably update Luna soon.

For the best support and guarantee that you are using the correct apiLevel, you should add the following to the top of new Lua documents you create:
Code: [Select]
platform.apilevel = '1.0'

or

platform.apilevel = '2.0'


Please note that using apiLevel 2.0 with the current Luna will result in an error. (I have a little customized version myself, but I'm not going to release it because it's Linux only, and I'm sure ExtendeD will update Luna soon.)


Events
*on.create is removed in apiLevel 2.0 and replaced with on.construction. This event handler is guaranteed to run before all others.
* on.getFocus is called when the script receives user input focus.
* on.loseFocus is called when the script loses user input focus.
* on.getSymbolList is called when the script app symbol list is being serialized to the clipboard.

Graphical operations
* Most graphical operations are now anti-aliased. This makes that applications look more pretty :)
* gc:setColorRGB now supports one number as input (as well as the old style). For example, you can do gc:setColorRGB(0xFF00CC) or gc:setColorRGB(0)
* You can not use coordinates for drawing to the screen above/under (-) 32 000. Normally this shouldn't affect anyone, but because of this Cubefield refuses to run.

* In apiLevel 2.0 platform.gc() is removed and replaced with platform.withGC(). An example of it:
Code: [Select]

function getStringWidth(str, gc)
  return gc:getStringWidth(str)
end

function on.construction()
  local strw = platform.withGC(getStringWidth, "The game")
end

So what it does it call the function you give as first argument and pass a dummy GC to it as last argument.

D2Editor
D2Editor is greatly improved, and it finally useful :)


require
There are three modules that you can 'require': physics, color, and strict.
The physics module is the chipmunk physics engine.
color is just a table containing colors. color.red (or color["red"]) will return the color code for red.
I have no idea what strict is or does :P

Usage: require 'modulename'


Physics
Maybe the best part of it of. OS 3.2 now includes the Open Source Chipmunk physics engine, and you can use it right from Lua!
This will allow some great games and applications :)
However it's is far to complex to detail in this post, so I will probably write a tutorial about it soon :)


Image
Normally 3.2 would have many updates to the image, but sadly enough they did not make 3.2 and are pushed for the next OS.
However, there is one function that made it, and that is image.rotate. This allows you to rotate images in anyway.
But beware, it is not the fastest function out there.

Math
math.eval has got some friends: math.evalStr, math.getEvalSettings and  math.setEvalSettings.

Platform
I already mentioned platform.withGC, but there are still two other newcomers:
* platform.registerErrorHandler, this allows you to take actions when an error occurs in your document. Pretty nice :)
* platform.window:setFocus, regain focus in your script.
* platform.hw(), returns a number corresponding to the device the scripts is running on.

Variable
* var.recallAt, fetch data from a certain spot in a list or matrix
* var.makeNumericList, create a list in the symbol table. The create list will work much more efficient with other var functions.

Toolpalette
In apiLevel 2.0 the names of toolpalette items may be changed dynamically while the program is running. Calling toolpalette.register(nil) deactivates the toolpalette.

Well, that's about it. I'm sure there are some stuff I forgot, but you can find them all in the API documentation here http://education.ti.com/downloads/guidebooks/ti-nspire/3.2/TI-Nspire_Scripting_API_Reference_Guide/TI-Nspire_Scripting_API_Reference_Guide_EN.pdf .
Good luck and may the coding force be with you!

Links:
Wiki version of this post with more details

20
Miscellaneous / Dutch and Belgian people unite!
« on: May 31, 2012, 03:32:21 pm »
Just trying to make a list of Dutch and Belgian people :P

Belgians:
Me
Stefan Bauwens
Nick
Hoffa
Ben_g
stevon8ter
JBelgier
PC5LeGeND

Dutch:
aeTIos
keoni29
Matthias1995

If you know more please comment :D

21
Lua / Video of 3.2 in action
« on: May 29, 2012, 03:09:32 pm »
The 3.2 OS will be soon out, so I made a video demonstrating some physics on an actual calculator (to show that it doesn't go that slow :P)



The car stuff is part of a future game that I am making :D
(the looks will change of course)

22
Humour and Jokes / Secret of the CAS+
« on: May 08, 2012, 09:33:18 am »
I just received my new CAS+ today, and guess what I found:



 *.*
Does that mean that TI is actually Casio?
Does it mean they were playing the game 6 years ago??
I don't know, but I think that this is just the top of the iceberg of stuff we are going to find!

Edit:
Some people think it's fake, so here is a real picture:

23
Math and Science / Polygon algorithm
« on: April 05, 2012, 05:46:32 am »
Does anyone here have a good algorithm to split a concave polygon in multiple convex ones?
I've looked a bit, but can't find an easy solution. In the worst case I just could use triangulation, but that's overkill in my opinion :P

TIA :)

24
Lua / PCspire, run Nspire lua programs nativly on your pc
« on: March 15, 2012, 03:51:57 pm »
Hello :)

Just wanted to show a little project I'm busy on.
As some of you know, I mainly develop on Linux. This means testing Nspire Lua programs is a bit harder.
Nspire_emu works fine, but there is no mouse support.
That is why I set out to create something to run Lua programs natively (meaning without emulation) on my computer.
I started 3 days ago, and here is the result:

Spoiler For screenshots:
(Colors are bad because of screen recorder)


EEPro (under dev) runs pretty good


Tetris:


Even different screen sizes if the lua script supports it:


And today I added a debugger:

( gvars() is a custom function of me that prints classes and/or objects )

I use the Löve Lua framework, since it was also event based and that made stuff a bit easier.

Stuff I still need to do:
  • Mouse cursor changing
  • D2Editor support (maybe too hard)
  • math.eval --> TI.Basic interpreter
  • Physics. Possible but very hard
  • Saving state of script done
If I forgot something I will update the list.

25
Other / Raspberry PI now available
« on: February 29, 2012, 07:27:55 am »
It's here! (Well, only model B for now)
http://www.raspberrypi.org/

But there is so much traffic that it's hard to buy one right now.
People internationally might also have to wait a bit.

Anyway, I'm going to buy one :)

26
Humour and Jokes / Just epic
« on: February 16, 2012, 05:20:42 am »
Paste this in your browsers url (while, for example reading a topic):
Code: [Select]
javascript:void(document.body.style.textTransform="uppercase");(Make sure javascript: is in the title bar)

Effect is awesome :D

27
Casio Calculators / MOVED: [Prizm] Tetrizm v1.0
« on: February 02, 2012, 11:44:05 am »
This topic has been moved to News.

http://ourl.ca/15093

28
News / nRGBlib for the TI-Nspire CX
« on: December 23, 2011, 01:31:22 pm »
While Nldess 3.1 is still under development, several projects have been started to make use of it's new features such as the ability to have color graphics on the CX.
nRGBlib is one of them. It's a graphical library made by totorigolo that uses the CX's color screen to draw beautiful graphics:



[ Invalid YouTube link ]

It has all of the functions you expect from a graphical library, so this will be a great help for anyone wanting to start with C coding on the TI-Nspire series.
Thanks to totorigolo for this nice library!

Source: TI-Planet

(as this is my first news post, I hope it's fine :D)

29
Other / z88 RAM/ROM prices (30 years ago)
« on: December 15, 2011, 11:13:36 am »
My dad has had a z88 for many years now, and he found this paper:


15 990 frank (for the 512k RAM pack) in that time was about 500 euro.
Times sure have changed =)

30
Site Feedback and Questions / Sugestions for quick reply
« on: December 07, 2011, 04:05:48 am »
When the user pressed the submit button, it should be disabled until the ajax object state changes.
This way accidental double postings can be avoided, as sometimes it looks like nothing happened when you pressed submit.

Also, if it takes longer than a certain amount to fetch the new post, you could maybe just refresh the page.

Just little suggestions :)

Pages: 1 [2] 3 4