Oeps, the zoomlevel was fixed to my testmodels. Will fix that. I didn't know about the material things, and I thought I was unloading them, but I guess not. I'll take a look at that also. I have no clue how this would behave on emulators, as it reads the card your using. I think some editors have issues with that.
Edit: The texture issue has been fixed, ready for the next update. Could anyone upload or mail me some VRML files for testing? Preferably a simple model without vertex colors as a benchmark, a simple model with vertex colors, and a somewhat more complicated model?
[ QUOTE ]
ElysiumGX:
if i'm not mistaken, that only happens if the models have the same material names assigned (eg, Default_Mat)
[/ QUOTE ]
I think you may be right. Both models have the material "default". But it would be nice to properly unload them to avoid any issues with numerous files to choose from.
For some more code polishing, I can't help but notice when switch between files, the first object goes black before loading the next. Perhaps you may try displaying the first model with texture until the next is loaded, while a loading bar or text is shown to let the user know it's working.
I'm considering getting an R4 just so I can use this. (: It's looking really promising.
On another note; zoom would be cool if it was activated by holding the left trigger and using the Y axis on the touch screen to move forward and back - it seems that it would work more like a 3D modeling app that way, plus, it's hard to use the right trigger and the touch screen at the same time. Although, I don't really have any idea how hard that function would be to write.
Not that just using the left and right triggers would be that much harder, though. P:
what about left and right on the D pad? That way you could use up & down to browse files, left and right to zoom, and your right hand would be free for rotation. . . though lefties probably hate me now.
At some point I'm going to have to add multiple tabs on the bottom screen anyway I think, so I was thinking of making the browser touchable at some point, and having a separate tab where you could do the rotation, and a vertical bar on either edge to use for zooming. A third tab could give you feedback on why a model didn't load for example. So you could basically control the entire thing with the stylus then. How does that sound?
Hey Labyrinh, great work! For the control scheme I would study the Color's DS interface as I find it simple and practical. E.g. For rotating you just need to move around the stylus, for zooming, hold 'up' on Dpad + stylus silding up and down for a progressive zooming , for panning, hold 'left' on Dpad + stylus mapping. Hold 'R' or 'L' for menus, etc...
- Now with correct auto-zooming, same camera controls.
- The texture issue on models after the first has been fixed.
- No cullling is used, so backfacing polygons will be rendered.
- Also on the right hand side of the screen is a red bar. This bar represents the triangle count used by the model. 2048 triangles (which is the max) will raise the bar to the top of the screen, 1024 will make it go halfway, etc. Due to me not culling anything anymore this bar will be constant per model. If I were to cull backfacing polygons it would fluctuate a little bit as more or less polygons are rendered.
The red bar is actually fluctuating while I rotate the model. It appears as if you've set the clipping plane a bit close, so bits of the models keep getting culled as they pass a certain distance from the camera (this is actually really obvious if you load the ball.obj model, whereby barely half the model is actually displayed).
Camera's working nicely, and models and textures are loading without a hitch for the most part. I'm having a bit of trouble with a model i'm working on now, whereby one of the meshes loads, but the other part (bionic arm) doesn't load at all.
As a side note, I love the camera controls you've implemented.
Well, it looks like I've screwed up the clipping planes somehow. Will need to check what's going on with those. You're probably best off waiting until then, since it might be working fine, just the clipping planes hiding everything.
I noticed last week that Max doesn't always give groups a name, something that I was expecting. I've fixed my version here for that, so that 'may' fix your issue. It should go up sometime this week. Can you load the 'good' models that were posted a ways back?
Been following the thread and just had a shot at the process - might be cool to update the 1st post in the thread with latest working links and settings (so long as we know what they are - seems a few folks are having different results)?
I'm having no joy on latest viewer - used export settings as noted on a test object, won't show up yet
Also the 'ball' object is the only one drawing, its textured but only draws as 2 tris... anyone else having these problems..?
Been following the thread and just had a shot at the process - might be cool to update the 1st post in the thread with latest working links and settings (so long as we know what they are - seems a few folks are having different results)?
I'm having no joy on latest viewer - used export settings as noted on a test object, won't show up yet
Also the 'ball' object is the only one drawing, its textured but only draws as 2 tris... anyone else having these problems..?
Cheers
Yeah, I screwed up something with the view when I added the camera controls I think. I'm pretty sure I have it sorted now, but still need to do some cleaning before I release the next version. I'm pretty sure it'll be this evening or tomorrow when I upload it.
For some reason the program has stopped working on an actual DS, but works fine in an emulator. Fixing that is a bit slow going, so I'm adding in the logging I mentioned before. You're not forgotten
This version should do the near and far planes correctly, although it will be a bit more conservative with the zoomlevel. I've also added some basic logging, so if something fails, hopefully you'll have a little bit more info. Use the shoulder buttons to switch between the file browser and the logs.
As usual comments and problem reports are appreciated.
I tried exporting a small model but couldn't get it to work. First i tried Max8, exported to obj, no UV no textures, just mesh. the viewer hangs at "Converting to DS format" for a little bit and then everything goes blank, no logging no response to buttons.
second i tried the same model but exported from Wings3D, same as before, no UV no textures, just mesh. I got an error message
"terminate called after throwing an instance of 'std::badalloc' what(): St8bad_alloc"
everything freezes after that. I can link you the objs I exported if it would help.
Hey Labyrinth, it works great when I edit my obj/mtl files to match your test format.
However, when exported straight from max, with no edits, it doesn't show the texture. The Obj points to the Mtl file, however, the MTL file doesn't specify a texture name, only material names. . .
I'm wondering if you could set it up so that if the DS Viewer can't find a texture pointer, it will look for a texture named the same as the material name?
That way I could simply name my material the same as my texture in the Max Material Editor, and when I export, it would then know which texture to look for.
Does that seem reasonable?
I can send you a couple test files if you want to see the straight Max export format.
Hmmm, Hito, it definately sounds like it's parsing the OBJ file incorrectly and trying to alloc an incorrect amount of memory (my guess is 0, but it could be too much as well).
Tumerboy: you mean there's no map_Kd entries in the mtl file? So what happens if you close max and reload from the obj file, does max then correctly show the textures? I can probably do the substitution thing fairly easily, but that does imply that all models will use textures which seems a bit iffy.
If you're both willing, please do send me the files. It's always good to have more files to test with. If you do, then preferably the files as exported from whatever app your using, without any edits. You should be able to find my mail address in my profile (unless the new boards somehow don't allow that).
And reimporting the obj into max yields a grey object.
Maybe I'm missing something on export or import, but I've scrubbed through those export options pretty thoroughly.
As for what happens if it isn't supposed to use a texture, what happens now? Isn't it just black anyway? Wouldn't it just be a black model if it couldn't find the texture?
Edit: I can't find your email, let me know and I'll send the files.
And reimporting the obj into max yields a grey object.
Maybe I'm missing something on export or import, but I've scrubbed through those export options pretty thoroughly.
As for what happens if it isn't supposed to use a texture, what happens now? Isn't it just black anyway? Wouldn't it just be a black model if it couldn't find the texture?
Edit: I can't find your email, let me know and I'll send the files.
I think the model is currently black in the viewer if it can't find the texture, but that naturally depends on the program. MAX might very well show it as grey. Clearly something's going wrong on export. Which MAX version are you using?
Ah got it. I was exporting at home from Max 9, I'm at work now and just did a quick test.
There's an "export maps" checkbox that I must have ignored before, thinking it would actually move my bmp's over or something. Anyway, checking that box, adds the map_Kd line to the MTL file.
Edit:
Here's the Max OBJ Exporter Panels, with all the settings I use to get it working in the viewer. (I think, I'm at work so I can't test it, but I'm pretty sure this is how I have it setup at home)
I just wanted to check in and see if anyone still has any issues with this? If not, then the following is the stuff I've got on my ToDo list, more or list in the order I plan on doing them:
-non 24-bit textures
-backface culling option
-control fov
-portrait mode (+autodetect if portrait mode would be nice)
-screenshots
-animating models
-vertex color support
maybe i'm missing something obvious, but nothing is working. gets to "Converting OK", which i'm assuming is the last step, but nothing on screen (just solid blue on top). i've tried numerous models, including the good files linked earlier.
that would make me buy a DS
have different animations, and being able to play them back.. say you have a runcykle going, and press a button to have the character jump, or go to an idle animation ..
wouldnt bother sending in demo reels, just walk up to the office where you'd wanna work, and start playing back animations on your ds ... there we go!
maybe i'm missing something obvious, but nothing is working. gets to "Converting OK", which i'm assuming is the last step, but nothing on screen (just solid blue on top). i've tried numerous models, including the good files linked earlier.
I have the same problem only my screen shows white.
I was also wondering how to get a .mtl file if I am using maya.
this is working great ! May I suggest to have a left-handed support? Like being able to press "Y" instead of "left" to zoom? Or are you planning to assign fonction to these buttons?
Had some problems when saving the texture as png, but it's working perfectly with bmp !
Got it working after a bit of messing around. Exported a 50 triangle mesh from maya with mtl that links to a 32x32px 24bit BMP.
Thanks for the wonderful app Labyrinth!
By the way, there is no texture alpha support yet right? How would I achieve this with a bmp? Some mtl-file line I add with an additional bmp file that is used for alpha?
I have now imported 6 different models created by different people with different errors and what not. I am using Maya. Here are some kinks and workaround I found when doing this. Might help someone. I am not entirely sure that all of these steps are absolutely necessary, but most of them are. I don't think you can go wrong by doing these steps.
1. The scale of your object is in fact very important. I had models that would not show up at all because of the objects scale. I use a working model for reference. But roughly the same size as Mayas default grid, around 24 Maya units works for me.
2. Make sure you don't have any dodgy faces. I had issues where faces with no actual geometrical area would f*ck up the OBJ. I would let me export but then I could not import the very same exported file. Solve this with Mesh > Cleanup.
3. Max 64x64 texture, 24bit BMP.
4. Triangulate your mesh. OBJ export does this anyway(?)
5. Use a basic material, no crazy stuff. Create a new lambert and use your BMP with a File node connected to the lamberts color channel.
6. Freeze Transformations.
7. Center your pivot, or set it at the models base. Not sure if this step is needed.
8. Delete the history of the object. Not sure if this step is needed, but deleting history is usually always a good idea.
9. Export your OBJ with materials option enabled. This should export an extra .mtl file as well as your .bmp file. I always edit my MTL in notepad and just add line breaks. Not sure if this is needed but I like the cleanliness and it works with linebreaks. This step is probably not needed.
Not sure if you are still maintaining this app Labyrinth, but I will keep pointing stuff out.
On my DS the viewer has an "inverted perspective", parts of an object that are further away appear bigger and vice versa. Anyone else noticed this or just on my DS? Something with the FOV?
Oh, and if you plan on implementing any other stuff then my vote would be on a cpanning camera control and alpha(this already in?)
Hi kodde (and everyone else as well). Thanks for the interest! I've not touched this in a while, but have been working to slowly getting MD3 animations working on my PC side viewer. I had planned to implement MD5 animations as well, and then move both animation types onto the DS viewer. I could do some cleanup at that point as well, so please do keep pointing things out. When I get closer to the cleanup stage I may ask for any non-working OBJ and 3DS files you may have so I can fix my importers.
The current ToDo list is more or less the following:
- Add animation support
- Add some kind of animation selecting page where you can select the animation (since multiple animations are often stored in the same file)
- Change the main viewing mode to portrait instead of landscape (and at the same time add support for holding the DS either way up)
- Clean up
I don't recommend holding your breath until this is all done, but some of it might be finished soonish.
I don't recall having 64x64 as maximum texture size, and I know for certain that the DS can go higher so it might be something at my end.
I remember reading this thread some time ago, and Now; seeing the updates (rotation, zoom features, etc.) this really got me wanting to try this out.
I could use some basic advice now as I don't know much about this:
I have tried for a couple hours now, and still no luck. I am using a G6 flash lite 4GB NDS card.
I can get other .nds files to work but not this 3d viewer file.
So here is what I have done:
I downloaded the latest software for the g6 lite.
I loaded the "ds_3dviewer.nds" file into the software (for the g6 lite) as you would any rom.
-I put the g6 lite card back in my ds and fired it up
-I selected the "ds_3dviewer.nds" file from the list of roms
-I have a white screen on the top and a black screen on the bottom. The black screen reads "FAT Init: Failed".
-If I press L+R+A+B (for the menu options) a error reads:
"terminate called after throwing an instance of 'std::bad_alloc what(): St9bad_alloc"
Now I have read through this thread, and maybe getting this software running on your ds is just common sense, but I don't seem to be getting it. I didn't bother putting any .obj files or texture files on the g6 lite card because I was assuming that when I click on the "ds_3dviewer.nds" file it would ask me to load the .obj and .bmp from there. But as I said, I just get an error, so I'm stuck at this point.
I figure I am missing something really simple with the setup, so please if anyone can help it would be much appreciated. I really want to get this to work.
hmmm... doing a little more research on the subject, I really think it might be because I am using the G6 lite instead of other, now more popular NDS cartridges.
I just bought the R4 DS Revolution w/2GB Kingston MicroSD Card from: http://www.modchipcentral.com/store/home.php
Since Paul_C mentioned the R4.
I'm guessing this will work fine, as I think its what others are using here. Now I have to wait for delivery
Labyrinth> Great to hear that you are still working on this! I imported my students Lowpoly assignments and showed them on the DS. There's a nice wow factor to actually having your own art spinning on a real console
Replies
Edit: The texture issue has been fixed, ready for the next update. Could anyone upload or mail me some VRML files for testing? Preferably a simple model without vertex colors as a benchmark, a simple model with vertex colors, and a somewhat more complicated model?
ElysiumGX:
if i'm not mistaken, that only happens if the models have the same material names assigned (eg, Default_Mat)
[/ QUOTE ]
I think you may be right. Both models have the material "default". But it would be nice to properly unload them to avoid any issues with numerous files to choose from.
For some more code polishing, I can't help but notice when switch between files, the first object goes black before loading the next. Perhaps you may try displaying the first model with texture until the next is loaded, while a loading bar or text is shown to let the user know it's working.
On another note; zoom would be cool if it was activated by holding the left trigger and using the Y axis on the touch screen to move forward and back - it seems that it would work more like a 3D modeling app that way, plus, it's hard to use the right trigger and the touch screen at the same time. Although, I don't really have any idea how hard that function would be to write.
Not that just using the left and right triggers would be that much harder, though. P:
Thanks for sharing this tool!!
- Now with correct auto-zooming, same camera controls.
- The texture issue on models after the first has been fixed.
- No cullling is used, so backfacing polygons will be rendered.
- Also on the right hand side of the screen is a red bar. This bar represents the triangle count used by the model. 2048 triangles (which is the max) will raise the bar to the top of the screen, 1024 will make it go halfway, etc. Due to me not culling anything anymore this bar will be constant per model. If I were to cull backfacing polygons it would fluctuate a little bit as more or less polygons are rendered.
Camera's working nicely, and models and textures are loading without a hitch for the most part. I'm having a bit of trouble with a model i'm working on now, whereby one of the meshes loads, but the other part (bionic arm) doesn't load at all.
As a side note, I love the camera controls you've implemented.
not much luck... testing with the cube and ball files you linked earlier. Updated R4DS kernel to latest, DLDI patched the viewer v9.
the cube doesn't load; the ball loads, but only 10 or so faces show on screen.
Any suggestions?
When I want to load a model, the soft bug
I have tried with just a box -> bug too
How about animated UVWs for textures?
Been following the thread and just had a shot at the process - might be cool to update the 1st post in the thread with latest working links and settings (so long as we know what they are - seems a few folks are having different results)?
I'm having no joy on latest viewer - used export settings as noted on a test object, won't show up yet
Also the 'ball' object is the only one drawing, its textured but only draws as 2 tris... anyone else having these problems..?
Cheers
Yeah, I screwed up something with the view when I added the camera controls I think. I'm pretty sure I have it sorted now, but still need to do some cleaning before I release the next version. I'm pretty sure it'll be this evening or tomorrow when I upload it.
This version should do the near and far planes correctly, although it will be a bit more conservative with the zoomlevel. I've also added some basic logging, so if something fails, hopefully you'll have a little bit more info. Use the shoulder buttons to switch between the file browser and the logs.
As usual comments and problem reports are appreciated.
The sample files you linked earlier worked great.
I tried exporting a small model but couldn't get it to work. First i tried Max8, exported to obj, no UV no textures, just mesh. the viewer hangs at "Converting to DS format" for a little bit and then everything goes blank, no logging no response to buttons.
second i tried the same model but exported from Wings3D, same as before, no UV no textures, just mesh. I got an error message
"terminate called after throwing an instance of 'std::badalloc' what(): St8bad_alloc"
everything freezes after that. I can link you the objs I exported if it would help.
However, when exported straight from max, with no edits, it doesn't show the texture. The Obj points to the Mtl file, however, the MTL file doesn't specify a texture name, only material names. . .
I'm wondering if you could set it up so that if the DS Viewer can't find a texture pointer, it will look for a texture named the same as the material name?
That way I could simply name my material the same as my texture in the Max Material Editor, and when I export, it would then know which texture to look for.
Does that seem reasonable?
I can send you a couple test files if you want to see the straight Max export format.
Let me know. Great work as always.
Tumerboy: you mean there's no map_Kd entries in the mtl file? So what happens if you close max and reload from the obj file, does max then correctly show the textures? I can probably do the substitution thing fairly easily, but that does imply that all models will use textures which seems a bit iffy.
If you're both willing, please do send me the files. It's always good to have more files to test with. If you do, then preferably the files as exported from whatever app your using, without any edits. You should be able to find my mail address in my profile (unless the new boards somehow don't allow that).
And reimporting the obj into max yields a grey object.
Maybe I'm missing something on export or import, but I've scrubbed through those export options pretty thoroughly.
As for what happens if it isn't supposed to use a texture, what happens now? Isn't it just black anyway? Wouldn't it just be a black model if it couldn't find the texture?
Edit: I can't find your email, let me know and I'll send the files.
I think the model is currently black in the viewer if it can't find the texture, but that naturally depends on the program. MAX might very well show it as grey. Clearly something's going wrong on export. Which MAX version are you using?
There's an "export maps" checkbox that I must have ignored before, thinking it would actually move my bmp's over or something. Anyway, checking that box, adds the map_Kd line to the MTL file.
Edit:
Here's the Max OBJ Exporter Panels, with all the settings I use to get it working in the viewer. (I think, I'm at work so I can't test it, but I'm pretty sure this is how I have it setup at home)
I have 3Ds max 7 but I hope that it will work.
-non 24-bit textures
-backface culling option
-control fov
-portrait mode (+autodetect if portrait mode would be nice)
-screenshots
-animating models
-vertex color support
Hold down LEFT and use the stylus to swipe down and up to zoom in and out respectively.
Viewer v11
I've researched VRML support, and it'll take a while I'm afraid.
Also, are there any small, inexpensive (or free) programs that do vertex painting easily?
However Textures arent working correctly
Texture is 64 colours
64 x 64 pixels (Wouldnt work with 128x128)
that would make me buy a DS
have different animations, and being able to play them back.. say you have a runcykle going, and press a button to have the character jump, or go to an idle animation ..
wouldnt bother sending in demo reels, just walk up to the office where you'd wanna work, and start playing back animations on your ds ... there we go!
I have the same problem only my screen shows white.
I was also wondering how to get a .mtl file if I am using maya.
Had some problems when saving the texture as png, but it's working perfectly with bmp !
Thanks for the wonderful app Labyrinth!
By the way, there is no texture alpha support yet right? How would I achieve this with a bmp? Some mtl-file line I add with an additional bmp file that is used for alpha?
1. The scale of your object is in fact very important. I had models that would not show up at all because of the objects scale. I use a working model for reference. But roughly the same size as Mayas default grid, around 24 Maya units works for me.
2. Make sure you don't have any dodgy faces. I had issues where faces with no actual geometrical area would f*ck up the OBJ. I would let me export but then I could not import the very same exported file. Solve this with Mesh > Cleanup.
3. Max 64x64 texture, 24bit BMP.
4. Triangulate your mesh. OBJ export does this anyway(?)
5. Use a basic material, no crazy stuff. Create a new lambert and use your BMP with a File node connected to the lamberts color channel.
6. Freeze Transformations.
7. Center your pivot, or set it at the models base. Not sure if this step is needed.
8. Delete the history of the object. Not sure if this step is needed, but deleting history is usually always a good idea.
9. Export your OBJ with materials option enabled. This should export an extra .mtl file as well as your .bmp file. I always edit my MTL in notepad and just add line breaks. Not sure if this is needed but I like the cleanliness and it works with linebreaks. This step is probably not needed.
Good luck.
On my DS the viewer has an "inverted perspective", parts of an object that are further away appear bigger and vice versa. Anyone else noticed this or just on my DS? Something with the FOV?
Oh, and if you plan on implementing any other stuff then my vote would be on a cpanning camera control and alpha(this already in?)
The current ToDo list is more or less the following:
- Add animation support
- Add some kind of animation selecting page where you can select the animation (since multiple animations are often stored in the same file)
- Change the main viewing mode to portrait instead of landscape (and at the same time add support for holding the DS either way up)
- Clean up
I don't recommend holding your breath until this is all done, but some of it might be finished soonish.
I don't recall having 64x64 as maximum texture size, and I know for certain that the DS can go higher so it might be something at my end.
EDIT: Oh and thanks for this.
I could use some basic advice now as I don't know much about this:
I have tried for a couple hours now, and still no luck. I am using a G6 flash lite 4GB NDS card.
I can get other .nds files to work but not this 3d viewer file.
So here is what I have done:
I downloaded the latest software for the g6 lite.
I loaded the "ds_3dviewer.nds" file into the software (for the g6 lite) as you would any rom.
-I put the g6 lite card back in my ds and fired it up
-I selected the "ds_3dviewer.nds" file from the list of roms
-I have a white screen on the top and a black screen on the bottom. The black screen reads "FAT Init: Failed".
-If I press L+R+A+B (for the menu options) a error reads:
"terminate called after throwing an instance of 'std::bad_alloc what(): St9bad_alloc"
Now I have read through this thread, and maybe getting this software running on your ds is just common sense, but I don't seem to be getting it. I didn't bother putting any .obj files or texture files on the g6 lite card because I was assuming that when I click on the "ds_3dviewer.nds" file it would ask me to load the .obj and .bmp from there. But as I said, I just get an error, so I'm stuck at this point.
I figure I am missing something really simple with the setup, so please if anyone can help it would be much appreciated. I really want to get this to work.
I just bought the R4 DS Revolution w/2GB Kingston MicroSD Card from: http://www.modchipcentral.com/store/home.php
Since Paul_C mentioned the R4.
I'm guessing this will work fine, as I think its what others are using here. Now I have to wait for delivery
Keep it up, thanks!