Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Gideros 2026.8 released — Gideros Forum

Gideros 2026.8 released

hgy29hgy29 Maintainer
Hi Giderians,

Here is a new Gideros version mostly to keep up with android tooling upgrade.
It also contains a nice addition for your 3D games: the native bump library (cbump) now support 3D, with an API insipred by bump-3dpd.
To enable 3D API, the newWorld() call now accepts three arguments: the cell size (as before), the required precision (if non zero, bump will align the resulting computations to the given grid spacing, thus avoiding some computations inaccuracies), and a boolean to enable 3D API. When 3D API is enabled, the Z coordinate is required and reported in all API calls.

Full change list:

Improvements
[sprite] Allow ghosts to be constructed through a callback
[sprite] Add getPostionVector function
[plugin/bump] Add 3D support
[plugin/bump] Add precision information to avoid computation errors
[export/android] Update to latest android tools
[export/ios] Improve orientation management
[plugin/iab] Use android billing client v9.1

Download it from here: http://giderosmobile.com/download
Tagged:
+1 -1 (+4 / -0 )Share on Facebook

Comments

  • MoKaLuxMoKaLux Maintainer
    edited July 30
    PS: when I use
    -- debug
    print(world:getCube(plane)) -- x, y, z, w, h, d
    print(world:getCube(player1)) -- x, y, z, w, h, d
    I don't get the z nor the depth
    256	192	0	3.200000047683716	128	0
    256	128	0	3.2	19.2	0
    So I assume I didn't setup up the world for 3D correctly 😢
    local world = BumpWorld.new(64, 0, true) -- (cellSize, precision, 3d)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    MoKaLux said:


    So I assume I didn't setup up the world for 3D correctly 😢

    local world = BumpWorld.new(64, 0, true) -- (cellSize, precision, 3d)
    Can you try:
    local world = cbump.newWorld(64, 0, true)

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Maintainer
    hgy29, that worked 👍

    I am so sorry, I was somehow using some very old code >:)

    This is a working example. I don't know how to set Mesh.new(is3d = true) in the Cuboid class, I believe I need to set it to true so I can change the z anchor point of the shapes.
    -- ***************************************
    Cuboid = Core.class(Mesh) -- I am trying to set Mesh.new(is3d = true)
     
    function Cuboid:init(w,h,d)
    	self._va = { -- vertex array
    		-w/2,h/2,-d/2, w/2,h/2,-d/2, w/2,-h/2,-d/2, -w/2,-h/2,-d/2,
    		w/2,h/2,d/2, -w/2,h/2,d/2, -w/2,-h/2,d/2, w/2,-h/2,d/2,
    		-w/2,-h/2,-d/2, w/2,-h/2,-d/2, w/2,-h/2,d/2, -w/2,-h/2,d/2,
    		-w/2,h/2,d/2, w/2,h/2,d/2, w/2,h/2,-d/2, -w/2,h/2,-d/2,
    		-w/2,h/2,d/2, -w/2,h/2,-d/2, -w/2,-h/2,-d/2, -w/2,-h/2,d/2,
    		w/2,h/2,-d/2, w/2,h/2,d/2, w/2,-h/2,d/2, w/2,-h/2,-d/2,
    	}
    	self._ia = { -- index array
    		1,2,3,1,3,4,
    		5,6,7,5,7,8,
    		9,10,11,9,11,12,
    		13,14,15,13,15,16,
    		17,18,19,17,19,20,
    		21,22,23,21,23,24,
    	}
    	self:setVertexArray(self._va)
    	self:setIndexArray(self._ia)
    	self.dims={w=w, h=h, d=d}
    end
     
    function Cuboid:mapColor(color,alpha)
    	for i = 1, #self._ia do
    		self:setColor(i, color, alpha or 1)
    	end
    end
     
    -- ***************************************
    application:setBackgroundColor(0x323232)
    application:configureFrustum(90) -- (fov, farplane)
     
    local cbump = require "cbump"
    local world = cbump.newWorld(nil, nil, true) -- (cellSize, precision>0, 3d)
     
    -- ground
    local plane = Cuboid.new(16*32, 0.1*32, 6*32) -- (w,h,d)
    plane:mapColor(0x0000a1, 0.5) -- color,alpha
     
    -- player1
    local player1 = Cuboid.new(0.65*32, 1.3*32, 0.4*32) -- (w,h,d)
    player1:mapColor(0xff0000, 0.5)
    player1.isup, player1.isdown, player1.isleft, player1.isright, player1.isjump = false, false, false, false, false
    player1.vx, player1.vy, player1.vz = 0*32, 0*32, 0*32
    player1.speed, player1.jumpspeed = 1*32, 2*32
    player1.filter = function(item, other) return "slide" end
     
    -- cubes
    local cubes = {}
    for i = 1, 4 do
    	cubes[i] = Cuboid.new(1*32, 1*32, 1*32) -- (w,h,d)
    	cubes[i]:mapColor(0x00a100, 0.5) -- color,alpha
    end
     
    -- anchor
    plane:setAnchorPoint(-0.5, -0.5, -0.5) -- need to set Mesh.new(is3d = true)?
    player1:setAnchorPoint(-0.5, -0.5, -0.5) -- need to set Mesh.new(is3d = true)?
    for i = 1, #cubes do
    	cubes[i]:setAnchorPoint(-0.5, -0.5, -0.5) -- need to set Mesh.new(is3d = true)?
    end
    -- position
    plane:setPosition(0*32, 7*32, 1*32)
    player1.x, player1.y, player1.z = 8*32, 0*32, 1*32
    player1:setPosition(player1.x, player1.y, player1.z)
    for i = 1, #cubes do
    	cubes[i]:setPosition(i*3*32, plane:getY()-cubes[i].dims.h, 1*32)
    end
    -- order
    stage:addChild(plane)
    stage:addChild(player1)
    for i = 1, #cubes do
    	stage:addChild(cubes[i])
    end
    -- cbump world
    world:add(
    	plane,
    	plane:getX(), plane:getY(), plane:getZ()-plane.dims.d/2,
    	plane.dims.w, plane.dims.h, plane.dims.d
    )
    world:add(
    	player1,
    	player1.x, player1.y, player1.z-player1.dims.d/2,
    	player1.dims.w, player1.dims.h, player1.dims.d
    )
    for i = 1, #cubes do
    	world:add(
    		cubes[i],
    		cubes[i]:getX(), cubes[i]:getY(), cubes[i]:getZ()-cubes[i].dims.d/2,
    		cubes[i].dims.w, cubes[i].dims.h, cubes[i].dims.d
    	)
    end
     
    -- game loop
    function updatePlayer1(xsprite, dt)
    	-- gravity
    	xsprite.vy += 40 * dt
    	-- cbump
    	local goalx = xsprite.x + xsprite.vx * dt
    	local goaly = xsprite.y + xsprite.vy * dt
    	local goalz = xsprite.z + xsprite.vz * dt
    	local nextx, nexty, nextz, collisions, len = world:move(xsprite, goalx, goaly, goalz, xsprite.filter)
    	-- collisions
    	for i = 1, len do
    		local col = collisions[i]
    		-- actor is on floor
    		if col.normal.y == -1 then -- continuous
    			col.item.vy = 0
    			col.item.isonfloor = true
    		end
    	end
    	-- keyboard handling
    	if xsprite.isleft then
    		xsprite.vx -= xsprite.speed * dt
    	elseif xsprite.isright then
    		xsprite.vx += xsprite.speed * dt
    	else
    		xsprite.vx = 0
    	end
    	if xsprite.isup then
    		xsprite.vz -= xsprite.speed * dt
    	elseif xsprite.isdown then
    		xsprite.vz += xsprite.speed * dt
    	else
    		xsprite.vz = 0
    	end
    	if xsprite.isaction1 then
    		if xsprite.isonfloor then
    			xsprite.vy = -xsprite.jumpspeed
    			xsprite.isonfloor = false
    			xsprite.isaction1 = false
    		end
    	end
    	-- move
    	xsprite.x = nextx
    	xsprite.y = nexty
    	xsprite.z = nextz
    	xsprite:setPosition(xsprite.x, xsprite.y, xsprite.z)
    end
     
    stage:addEventListener(Event.ENTER_FRAME, function(e)
    	updatePlayer1(player1, e.deltaTime)
    end)
     
    -- keys handler
    stage:addEventListener(Event.KEY_DOWN, function(e)
    	if e.keyCode == KeyCode.UP then player1.isup = true end
    	if e.keyCode == KeyCode.DOWN then player1.isdown = true end
    	if e.keyCode == KeyCode.LEFT then player1.isleft = true end
    	if e.keyCode == KeyCode.RIGHT then player1.isright = true end
    	if e.keyCode == KeyCode.SPACE then player1.isaction1 = true end
    end)
     
    stage:addEventListener(Event.KEY_UP, function(e)
    	if e.keyCode == KeyCode.UP then player1.isup = false end
    	if e.keyCode == KeyCode.DOWN then player1.isdown = false end
    	if e.keyCode == KeyCode.LEFT then player1.isleft = false end
    	if e.keyCode == KeyCode.RIGHT then player1.isright = false end
    	if e.keyCode == KeyCode.SPACE then player1.isaction1 = false end
    end)
    I need to push it further for the wiki but this is a starting point. Thank you 🙋‍♂️
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Maintainer
    edited August 3
    in the meantime to have proper collision on the z axis you would need to change the Cuboid vertex array to:
    	self._va = { -- vertex array (Origin at Left, Bottom, Back)
    		-- Front Face (Z = d)
    		0,h,d, w,h,d, w,0,d, 0,0,d,
    		-- Back Face (Z = 0)
    		w,h,0, 0,h,0, 0,0,0, w,0,0,
    		-- Bottom Face (Y = 0)
    		0,0,d, w,0,d, w,0,0, 0,0,0,
    		-- Top Face (Y = h)
    		0,h,0, w,h,0, w,h,d, 0,h,d,
    		-- Left Face (X = 0)
    		0,h,0, 0,h,d, 0,0,d, 0,0,0,
    		-- Right Face (X = w)
    		w,h,d, w,h,0, w,0,0, w,0,d,
    	}
    Then you don't need to modify the anchor point and z offset
    -- anchor
    --plane:setAnchorPoint(-0.5, -0.5, -0.5) -- need to set Mesh.new(is3d = true)?
    --player1:setAnchorPoint(-0.5, -0.5, -0.5) -- need to set Mesh.new(is3d = true)?
    --for i = 1, #cubes do
    --	cubes[i]:setAnchorPoint(-0.5, -0.5, -0.5) -- need to set Mesh.new(is3d = true)?
    --end
     
    -- cbump world
    world:add(
    	plane,
    	plane:getX(), plane:getY(), plane:getZ(),
    	plane.dims.w, plane.dims.h, plane.dims.d
    )
    world:add(
    	player1,
    	player1.x, player1.y, player1.z,
    	player1.dims.w, player1.dims.h, player1.dims.d
    )
    for i = 1, #cubes do
    	world:add(
    		cubes[i],
    		cubes[i]:getX(), cubes[i]:getY(), cubes[i]:getZ(),
    		cubes[i].dims.w, cubes[i].dims.h, cubes[i].dims.d
    	)
    end


    Ultimately that would be best to be able to set Mesh.new(is3d = true) in the Cuboid class 🤷‍♂️

    Viva Gideros 🍰
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    MoKaLux said:

    Cuboid = Core.class(Mesh) -- I am trying to set Mesh.new(is3d = true)
    You can enable 3D mode in Mesh that way:
    Cuboid = Core.class(Mesh,function() return true end)

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Maintainer
    I think I tried this but the collisions are still offset on the z axis 🙃
    --Cuboid = Core.class(Mesh) -- I am trying to set Mesh.new(is3d = true)
    Cuboid = Core.class(Mesh, function() return true end)
    -- anchor
    plane:setAnchorPoint(-0.5, 0.5, -0.5)
    player1:setAnchorPoint(-0.5, 0.5, -0.5)
    for i = 1, #cubes do
    	cubes[i]:setAnchorPoint(-0.5, 0.5, -0.5)
    end
    print(plane:getAnchorPoint()) -- -0.5	0.5		no z anchor!?
    Changing the Cuboid vertex array (code above) works as expected. I will have to decide which way to go for the wiki, aka I need more time 😉.

    Thank you hgy29, I will be back (God's willing).
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    MoKaLux said:

    I think I tried this but the collisions are still offset on the z axis 🙃

    Yes, sorry I misread your code. set/getAnchorPoint doesn't work for 3D, since Sprites don't have a depth by default. You should use setAnchorPosition instead

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.