That makes sense since it is backed up by my experience. But I strongly suppose that the version from the model loader must also work in some way, otherwise the Passivist would have written it different. That is why I am asking.
|
Well. When you use the ClassLoader class is when you need to read your sources by using URLs, the other ways of reading are by using paths that are not URLs. The difference is that you can use the ClassLoader class from inside a package (myfile.jar), but the others only work when you have all-Permissions.
Hope that clarifies it. |
In reply to this post by Estajxo
And that's just to name the most important cases. There are other instances that you will learn while you are coding.
|
Administrator
|
In reply to this post by Estajxo
You should have removed the whole entry from your file like I do here: http://tuer.svn.sourceforge.net/viewvc/tuer/pre_beta/.classpath?revision=505&view=markup It is supported by Eclipse, I have done that since 2006. getResource() works well with Unix-like path even under Windows, you read wrong things. Putting the models into "src" is a really bad idea. If you don't succeed in cleanly fixing your problem, just send me your files by email and I will explain to you what I modify to allow you to understand my changes.
Julien Gouesse | Personal blog | Website
|
Administrator
|
In reply to this post by Estajxo
>But I strongly suppose that the version from the model loader must also work
>in some way, otherwise the Passivist would have written it different. That is why I am asking. Internally the model loader uses the classloader in more or less the same way you did: new BufferedInputStream((new Object()).getClass().getResourceAsStream(inModelPath)) ... so the "path" you supply only has to be in reach of the classloader and can be an URL too if you like. I myself don't start my JOGL application direcly out of eclipse but use ant to deploy to a dedicated deployment location and start it manually from there. |
In reply to this post by gouessej
The last entry of the linked example still shows the entry, only with an empty String. This is what I have done, too. Anyway, I now found one solution quite workable which is described here: http://lj4newbies.blogspot.de/2008/03/using-classgetresource-load-resource.html I suppose this is a "clean" solution, isn't it? If not, what are the disadvantages? Anyway, thanks a lot for your support! As a reward I would like to share my results regarding this. My Blender model now looks like this inside my application: Pretty flat shading still, but at least it is there. More vivid shading will need lighting, I suppose. But also, as you can see I added some material to my model, like the black screen and the white eyes. Is there any way to recover those in the application? So far I just set the glColor to this bluey color (or any other) and the material is lost. |
Administrator
|
>But also, as you can see I added some material to my model,
>like the black screen and the white eyes. Is there any way to recover those in the application? Generally u can't use the materials u see in in Blender directly in JOGL/OpenGL, but there are multiple ways to work around this. Personally I use a combination of "texture baking" and "uv unwrapping" (google for these) to export materials as textures from blender. The rest I add with shaders manually in my application. Another way is to use the "blender game engine" and use the materials provided there. These can be easily reverse engineered/extracted from the engine and used with JOGL. |
Hi passivist, after importing the Blender model into JOGL is there any way to change the color of model components?
|
Administrator
|
Not with the loader I'm using. But I'm sure there are loaders out there that use the .mtl files from blender that are dropped with the .obj files.
But as stated before to change any part of an exported object blender I would go for the texture/shader solution to change the appearance. Its the most flexible way. |
Free forum by Nabble | Edit this page |