Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Gideros 3D — Gideros Forum

Gideros 3D

MoKaLuxMoKaLux Member
edited March 23 in General questions
Let me create this thread to talk about general Gideros 3D stuff.

I will start with the currently supported 3D formats:
- you can import .obj
- you can import .glb
- you can import fbx (with or without animations) through fbxconv.

All the above supported formats work on all os: android, windows, html5?, cannot tell for other os but should work fine according to forum feedback :)

There is although a catch with .glb:
- glb files with embedded image textures ONLY work on desktops

I am working on it DONE, see post below :)

Likes: hito9

my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
Tagged:
+1 -1 (+1 / -0 )Share on Facebook

Comments

  • MoKaLuxMoKaLux Member
    edited March 23
    MoKaLux said:

    There is although a catch with .glb:
    - glb files with no image textures (only vertex color) work on all os
    - glb files with embedded image textures ONLY work on desktops

    I am working on it :)

    Great news, I got it working on my android with the help of hito9 :)

    There is the updated 3d-anim sample https://github.com/mokalux/GIDEROS_LUAU_SAMPLES/tree/main/3D-Anim
    @hito9 could you please check if it is working now for linux :) ?

    PS: I learnt a bit more about Gideros Buffer https://wiki.gideros.rocks/index.php/Buffer + I updated the wiki https://wiki.gideros.rocks/index.php/File_system as I could understand it :p

    Likes: hito9

    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
    +1 -1 (+1 / -0 )Share on Facebook
  • hito9hito9 Member
    Accepted Answer
    MoKaLux said:

    There is the updated 3d-anim sample https://github.com/mokalux/GIDEROS_LUAU_SAMPLES/tree/main/3D-Anim
    @hito9 could you please check if it is working now for linux :) ?

    @MoKaLux, Confirm :), 3D-Anim, 3DDemo1, 3D_Collisions issues has been fixed for Linux too.
    MoKaLux said:

    PS: I learnt a bit more about Gideros Buffer https://wiki.gideros.rocks/index.php/Buffer + I updated the wiki https://wiki.gideros.rocks/index.php/File_system as I could understand it :p

    Me too thanks to you.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Member
    Glad it is working :) pull request to gideros GH sent :)

    I got 3d-Anim working on my old samsung S5 :o

    PS: reactPhysics3D crashes on me on android :'(

    Likes: hito9

    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
    +1 -1 (+1 / -0 )Share on Facebook
  • hito9hito9 Member
    Accepted Answer
    MoKaLux said:

    PS: reactPhysics3D crashes on me on android :'(

    Can you post your backtrace log for @hgy29 . As I remember it was easy to debug with Android studio.
  • MoKaLuxMoKaLux Member
    edited March 23
    yes I am trying this with android studio but I need to find the as plugin to connect my phone via wifi (too lazy to connect it via usb :D )

    EDIT: FYI here is the debug log for reactphysics3d
    2022-03-23 09:42:43.586 5462-5495/? A/libc: Fatal signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xc3c8f4ae in tid 5495 (GLThread 3155), pid 5462 (deros.myplayer2)
    2022-03-23 09:42:43.642 5534-5534/? E/crash_dump32: unknown process state: t
    2022-03-23 09:42:43.701 5534-5534/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    ...
    2022-03-23 09:42:43.703 5534-5534/? A/DEBUG: pid: 5462, tid: 5495, name: GLThread 3155 >>> com.gideros.myplayer2 2022-03-23 09:42:43.946 5534-5534/? A/DEBUG: #00 pc 0007f1b8 /data/app/com.gideros.myplayer2-rKjp2Uokf6LbMgpBUHDttQ==/lib/arm/libreactphysics3d.so (reactphysics3d::Set, std::__ndk1::equal_to>::add(reactphysics3d::PhysicsWorld* const&)+376) (BuildId: 27861399df68658ff5a6bef14ee8cf8e4ba316a5)
    2022-03-23 09:42:43.946 5534-5534/? A/DEBUG: #01 pc 0007f010 /data/app/com.gideros.myplayer2-rKjp2Uokf6LbMgpBUHDttQ==/lib/arm/libreactphysics3d.so (reactphysics3d::PhysicsCommon::createPhysicsWorld(reactphysics3d::PhysicsWorld::WorldSettings const&)+84) (BuildId: 27861399df68658ff5a6bef14ee8cf8e4ba316a5)
    2022-03-23 09:42:43.946 5534-5534/? A/DEBUG: #02 pc 0002d000 /data/app/com.gideros.myplayer2-rKjp2Uokf6LbMgpBUHDttQ==/lib/arm/libreactphysics3d.so (BuildId: 27861399df68658ff5a6bef14ee8cf8e4ba316a5)
    2022-03-23 09:42:43.946 5534-5534/? A/DEBUG: #03 pc 0004f608 /data/app/com.gideros.myplayer2-rKjp2Uokf6LbMgpBUHDttQ==/lib/arm/liblua.so (BuildId: 3ee4fcbdd4478ca757e431b177f16d920dfcc349)
    2022-03-23 09:42:43.946 5534-5534/? A/DEBUG: #04 pc 0002c520 /data/app/com.gideros.myplayer2-rKjp2Uokf6LbMgpBUHDttQ==/lib/arm/liblua.so (BuildId: 3ee4fcbdd4478ca757e431b177f16d920dfcc349)
    2022-03-23 09:42:43.946 5534-5534/? A/DEBUG: #05 pc 00023ec4 /data/app/com.gideros.myplayer2-rKjp2Uokf6LbMgpBUHDttQ==/lib/arm/liblua.so (lua_call+36) (BuildId: 3ee4fcbdd4478ca757e431b177f16d920dfcc349)
    2022-03-23 09:42:43.946 5534-5534/? A/DEBUG: #06 pc 001483dd /data/app/com.gideros.myplayer2-rKjp2Uokf6LbMgpBUHDttQ==/lib/arm/libgideros.so (BuildId: db5e5e7af1c5709e2476d1cd2a2a1740c01f3421)

    I will see what I can get out of this.
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    I tried to narrow down the error and found it crashes when creating the r3d world:
    LevelX = Core.class(Sprite)
     
    local r3d = require "reactphysics3d"
     
    function LevelX:init()
    	-- create r3d physics world
    	self.world=r3d.World.new(0, 0, 0) -- CRASH
    --	self.world={} -- NO CRASH
    	-- some lists to store coming objects (deco, bodies, ...)
    	self.world.deco = {}
    I am trying to found out how :)

    FYI: r3d doesn't work on html5 as well
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    edited March 30
    I have an issue with r3d and collision detection nothing seems to work :'(
    Before I could write this:
    g_world:setEventListener(function()
    	-- missiles vs enemies collisions
    	for k,v in pairs(g_missiles01) do
    		for k1,v1 in pairs(g_enemies02) do
    			if g_world:testAABBOverlap(v.body, v1.body) then
    				g_score += 10
    				self.scoretf:setText("SCORE :"..g_score)
    				...
    			end
    		end
    	end
    	-- player1 vs enemies collisions
    	for k,v in pairs(g_enemies02) do
    		if g_world:testAABBOverlap(v.body, self.player1.body) then
    			self.lives -= 1
    			self.livestf:setText("LIVES: "..self.lives)
    			...
    		end
    	end
    end)
    But this no longer works.
    When I try various collision detection (testCollision, testAABBOverlap, testOverlap) I have errors like these:
    	-- world listener
    	self.world:setEventListener(function() print("xxx") end) -- BUG!?
    ERROR: scenes/levelX.lua:74: Failed to step world, something is not set up correctlyhttps://github.com/mokalux/GIDEROS_LUAU_SAMPLES/blob/21b0fea1097ccc02aecc16ea9e7416aa4a72d1a5/R3D_TypeTH/assets/scenes/levelX.lua#L39
    function LevelX:player1CollisionCallBack()
    	print("player1 down!")
    	print(self.tiled_level.player1.view) -- BUG!?
    end
    		-- test collisions
    		self.world:testCollision(v, self.tiled_level.player1.body, self.player1CollisionCallBack) -- BUG!?
    ERROR: player1 down!
    scenes/levelX.lua:53: attempt to index nil with 'player1'
    stack traceback:
    scenes/levelX.lua:53: in function player1CollisionCallBack
    scenes/levelX.lua:134: in function onEnterFrame
    https://github.com/mokalux/GIDEROS_LUAU_SAMPLES/blob/21b0fea1097ccc02aecc16ea9e7416aa4a72d1a5/R3D_TypeTH/assets/scenes/levelX.lua#L134
    ...

    I have a sample project on GH if somebody is willing to have a look: https://github.com/mokalux/GIDEROS_LUAU_SAMPLES/tree/main/R3D_TypeTH


    Thank you :)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    I need your insights :)
    How can we use https://wiki.gideros.rocks/index.php/R3d.World:setEventListener ?

    From reactbinder.cpp there is:
    class GidEventListener: public EventListener {
    public:
    	lua_State *L;
    	int cbn;
    	virtual void onContact(
    			const CollisionCallback::CallbackData& ci) {
    		int nbc=ci.getNbContactPairs();
    		for (int k=0;k
    But in lua when I try to add this code to 3D Collisions sample code:
    r3d=require "reactphysics3d"
     
    -- Create physics world
    local world=r3d.World.new(0,-9.8,0)
     
    -- various collision detection
    function collisionsEventListener()
    	print("collision")
    end
    world:setEventListener(collisionsEventListener)
    I have this error:
    Uploading finished.
    main.lua:88: Failed to step world, something is not set up correctly

    Anybody :) ?
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    It is a bug introduced by the switch to luau. I have fixed it for next release.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Member
    Thank you hgy29 your fix works fine but I am sorry to tell there are some more bugs? regarding r3d collisions and destroy body? or is it me?
    stage:addEventListener(Event.ENTER_FRAME,function(e)
    	-- destroy body before world step?
    	if box02.body.isdirty then
    		box02.body.isdirty = false
    		print("box02 is dirty is true, try to destroy it!")
    --		world:destroyBody(box02.body) -- CRASH!
    	end
    ...
    here is a sample project which crashes gideros player with no information :'(

    PS: I tried figuring it out myself but too little experience with c++ :'(
    zip
    zip
    3D Collisions 2.zip
    167K
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    and a sample project with testAABBOverlap crash :s
    Sorry to bother guys :(
    zip
    zip
    3D Collisions 2_AABB.zip
    167K
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    @MoKaLux, in your first test it crashes because you keep querying the body (body:getTransform()) after having destroyed it. I will try to add more sanity checks to avoid crashing in these cases.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    @MoKaLux, second test is even easier: testAABBOverlap function isn't implemented

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • MoKaLuxMoKaLux Member
    Perfect capitain thank you.
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • MoKaLuxMoKaLux Member
    thanks to hgy29 I managed to put a 3d collision 2. I would like to propose it as an additional demo to gideros build?
    It demonstrates quite a few steps:
    - r3d.Fixture:setMaterial(material)
    - destroybody
    - move body with arrow keys

    It is the same as current 3d collision, so we could also change it with this new demo? What do you think?
    zip
    zip
    3D Collisions 2.zip
    132K
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
Sign In or Register to comment.