As @john26 reminded, we have 3D support in gideros since some time now (almost a year), so I wondered if gideros could be up to the task for a first person 3D game.
Here is a quick HTML5 demo of what we can do: http://hieroglyphe.net/3d/gideros.html (quick scene modeling by @Athanyse, my sister BTW). Ok, textures are misplaced, you can cross the walls on so on, but I guess games based on 3D are indeed possible with our favorite SDK!
Is it supposed to look like the attached image? (FireFox) It also doesn't even load in IE11. Actually no, after about 3 minutes of leaving the script frozen, it grunted to life. Looks like the FireFox screendump still.
Its great to see it actually be 3D in Gideros regardless of the issues though
Yes @antix, that's what it looks like. Controls are minimalist: you can just look around by dragging the mouse, and go forward by clicking on the arrow button. And the scene doesn't look like the original blender one, my .obj importer is not behaving correctly. I am still working on it.
@ar2rsawseen: the demo was made for phones/tablets first, that's why I didn't handle mouse hover nor WASD. But I can add them!
@hgy29, as well as wasd it's also good to add cursors for people who don't know the regular keys.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Hi @NatWobble, I used the same approach as in horse example, with an enhanced .obj file loader and proper Sprite transforms to mimic camera placement. So basically only meshes!
@hgy29 - I had much trouble getting the loader from the horse example to load my obj files (I used Xbly's .x and obj exporter from inside Sketchup). I had to manually edit my exported data to be exactly like the data provided with the example for it to work.
@tkhnoman - I think I had issues with that as well, since my exporter (non pro version) exports the obj file in a strange ways. I'll look at thgast tomorrow though, thanks.
@tkhnoman - That was the code I was using and it doesn't work with the exported data I have created. I'm using SketchUp 2015 non pro.
objloader.lua:40: bad argument #1 to 'lines' (sketchUpFile/C:/Users/Cliff/Documents/CIRCLE.mtl: Invalid argument)
It seems to be having some issue with the material file. I have it flagged to look at one day when I have some time. Personally I'm not ready to be making 3D programs with Gideros right now.
A simple 3D loader that can display a model of like inventory items would be pretty cool though.
@tkhnoman - I have tried both the exporter you linked and another one I found on the net with the same result. Maybe SketchUp 2015 has some differences. Anyway, I'll look closer one day
@hgy29: The demo you posted up there, which browser is it compatible to? On Firefox ESR 38.6.1 and Windows 7 I get a blank white screen once the loading is finished.
Hi @MikeHart, it ought to work on FF, Edge, Safari and Chrome. I use firefox most of the time, and I have version 44.0.2. Not sure why it doesn't work in your configuration, does your FF report something in the web console (F12) ?
Theoretically, one could use MovieClip/gtween to animate meshes loaded this way. BTW, does someone knows a better format than .obj ? something more compact would be good.
Project update: Added normal handling/basic lighting through shaders. See the difference on the picture: - Top-Left: previous version (no normals/lighting) - Top-Right: new version (notice rounded shapes) - Bottom image: original blender scene
Now I need to compute shadows, and I already know this is a complex task!
We've decided (with @Athanyse) to try and add lightmap/bumpmap/normalmap to the next version. I am quite happy with it already, it seems usable enough to build a game. Just need to come out with some original scenario (I was hoping to build an adventure game, like Myst/Riven series).
It could be suitable for a FPS too, or something like Portal..
Comments
Sure that will look better soon
Good job hgy29!
Would be much better with WASD and also you can capture mouse movement without click too, using Event.MOUSE_HOVER
Don't know if HTML5 supports it though
Its great to see it actually be 3D in Gideros regardless of the issues though
And the scene doesn't look like the original blender one, my .obj importer is not behaving correctly. I am still working on it.
@ar2rsawseen: the demo was made for phones/tablets first, that's why I didn't handle mouse hover nor WASD. But I can add them!
https://deluxepixel.com
Likes: antix, pie, NatWobble
Did you tried this? http://giderosmobile.com/forum/discussion/5631/load-from-sketchup-3d-obj-export/p1
Looks better already!
objloader.lua:40: bad argument #1 to 'lines' (sketchUpFile/C:/Users/Cliff/Documents/CIRCLE.mtl: Invalid argument)
It seems to be having some issue with the material file. I have it flagged to look at one day when I have some time. Personally I'm not ready to be making 3D programs with Gideros right now.
A simple 3D loader that can display a model of like inventory items would be pretty cool though.
Also, i'm using exporter that i provided in the link.
BTW, does someone knows a better format than .obj ? something more compact would be good.
How about using http://www.assimp.org/ to support even more formats?
Likes: antix, SinisterSoft, pie
Added normal handling/basic lighting through shaders. See the difference on the picture:
- Top-Left: previous version (no normals/lighting)
- Top-Right: new version (notice rounded shapes)
- Bottom image: original blender scene
Now I need to compute shadows, and I already know this is a complex task!
Likes: MikeHart, pie, antix, jeromegsq, totebo
http://hieroglyphe.net/3d/gideros.html
Likes: SinisterSoft, antix
We've decided (with @Athanyse) to try and add lightmap/bumpmap/normalmap to the next version. I am quite happy with it already, it seems usable enough to build a game. Just need to come out with some original scenario (I was hoping to build an adventure game, like Myst/Riven series).
It could be suitable for a FPS too, or something like Portal..
Likes: pie