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/.gltf
- you can import fbx (with or without animations) through
fbxconv- you can import magicavoxel (new)
-
unitypackage - .vox
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 desktopsI am working on it DONE, see post below
Comments
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
Likes: hito9
Likes: MoKaLux
I got 3d-Anim working on my old samsung S5
PS: reactPhysics3D crashes on me on android
Likes: hito9
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.
FYI: r3d doesn't work on html5 as well
Before I could write this:
When I try various collision detection (testCollision, testAABBOverlap, testOverlap) I have errors like these:
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 onEnterFramehttps://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
How can we use https://wiki.gideros.rocks/index.php/R3d.World:setEventListener ?
From reactbinder.cpp there is:
Uploading finished.
main.lua:88: Failed to step world, something is not set up correctly
Anybody ?
Likes: MoKaLux
PS: I tried figuring it out myself but too little experience with c++
Sorry to bother guys
Likes: MoKaLux
Likes: MoKaLux
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?
When you switch from menu to level the models data are kept in memory and the memory will add up every time you switch from menu to level.
The issue seems to be related to D3Anim, D3, G3DFormat not being freed (even when I nil the models before going to the menu scene)
Do you know how I could prevent the memory leaks, what are the biggest values (tables) that could be nilled?
I have a test file attached.
Thank you for any help
In 3D is there an OpenGL parameter I can tweak so a texture is not hidden by a transparent texture placed above it?
Some images to make more sense
Image 3 is the back view of a 3D wall clock with a texture
Image 2 is the thin glass (semi-transparent) over the wall clock
Image 1 is the front of the wall clock (with the thin glass above it) which hides the texture below it
I don't know if it is has something to do with clipping, an OpenGL setting or ...
Any hints would be much appreciated , thank you
PS: this is an .obj 3D object rendered through a render target using the 3dbase libraries
PS2: I tried setCullMode but the images are not drawn at all when rotating the object (Sprite.CULL_FRONT, Sprite.CULL_BACK)
Likes: MoKaLux
So I would say the object (the textures) is rendered from back to top(?) and this relative to the camera (the object can rotate though).
The values for the Z layer (for the object and the textures) should be different, I would say the back of the clock, then the "cadran" then the glass(?).
PS: this happens only with textures. For an .obj car with vertex color (no textures), the car has some windows and I can see through the window (for example the interior of the car)
Within the single 3D model the surfaces don't get rendered in an order you can easily rely on. Any surfaces that include transparent areas might occlude surfaces behind it, since the farther surfaces might get rendered after the near ones, and any surface, even one with a transparent texture, will update the depth buffer. That is, it marks that spot on the image as having been drawn at the distance of that surface, and not to bother drawing any surfaces further away on that part of the screen.
What I do to deal with this is make two versions of the model: One that includes all the opaque textures, and one for the transparent ones. Then I load both models, opaque one first, and keep them in the same position and orientation at all times. Then the translucent ones get rendered last.
You could take this further, making it simpler to deal with these kinds of models, by having two children of the 3D scene, added in order: One for all the opaque objects, and one for all the transparent or translucent ones. Then all the the solid objects will be rendered first, and visible through all the translucent ones.
If objects aren't included in the scene in order so the nearest ones are first (which is computationally expensive to maintain if the objects or the camera are moving a lot) then having all the transparencies in one child like that, you would still see some nearer partially transparent surfaces occlude others behind them.
Paul
Likes: MoKaLux
I now have a better understanding of 3D and depth buffer issue
EDIT: I managed to make it work
What I did was in Blender, instead of merging the objects (clock, wood, needles, glass) I parented them to the wood object (maybe I am lucky that the z order is correct?)
Viva Gideros!