We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › objLoader 014 : now with VBO!
Pages: 1 2 3 
objLoader 014 : now with VBO! (Read 5011 times)
Re: objLoader 014 : now with VBO!
Reply #15 - Jul 26th, 2008, 3:24am
 
I'm asking if one model with multiple textures can be exported with multiple alpha channels?  And how can the alpha channels be turned on in processing?
Re: objLoader 014 : now with VBO!
Reply #16 - Jul 26th, 2008, 10:05am
 
If you use png files with alpha channels as your textures, then it should "just work" I think... though you might have to add 2 commands:

gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE_MINUS_SRC_ALPHA);
Re: objLoader 014 : now with VBO!
Reply #17 - Jul 26th, 2008, 9:50pm
 
Is Opengl's coordinate system different when I access it directly.  My model is oriented very strangely.  When I sgsrules' library.
Re: objLoader 014 : now with VBO!
Reply #18 - Jul 28th, 2008, 11:37pm
 
post some code an maybe a link to your model and i'll check it out.
Re: objLoader 014 : now with VBO!
Reply #19 - Aug 23rd, 2008, 6:08pm
 
this is just a suggestion.
have u ever thought of loading multiple object obj files ?
i gave this lib a try and when i tried to load +2 objects in a obj scene it crashes..

Re: objLoader 014 : now with VBO!
Reply #20 - Aug 23rd, 2008, 11:02pm
 
If you can post a sample scene I can sort it out.
Re: objLoader 014 : now with VBO!
Reply #21 - Aug 24th, 2008, 9:13pm
 
sure.. this is a tree sample made of trunk, branches and leafs..
it uses relative coordinates and seperates all objects..

check this:
www.pixelnerve.com/downloads/GiantSequoia.obj
Re: objLoader 014 : now with VBO!
Reply #22 - Aug 24th, 2008, 10:59pm
 
the obj looks ok. (lot's of poly's but ok) can you post some code.
Re: objLoader 014 : now with VBO!
Reply #23 - Aug 25th, 2008, 1:15pm
 
polymonkey,
i havent wrote any code. i basically gave a try to objloader and tried to load that obj file.

it crashed, and i thought it could be that the obj has multiple objects. ive exported it as a single object scene and it worked.

i just wanted to tell u that. maybe you could implement that in the lib. it would be good for me as a user. you would save me alot of work =)
Re: objLoader 014 : now with VBO!
Reply #24 - Aug 28th, 2008, 6:09pm
 
ok,

i had to write a simple obj loader for my needs.

it works for me, just wanted to put it up for anyone who wants it. im sure ull find lots of probs. i dont check for anything.

it works for triangles only, u need to group objects and other limitations i did not care about.

warning: its not made for general public, it was made for myself, so be gentle.

www.pixelnerve.com/downloads/processing/objloader_sample.zip
Re: objLoader 014 : now with VBO!
Reply #25 - Aug 29th, 2008, 11:59pm
 
Nice work, I'll look at getting group support into the objloader in the coming weeks.

M
Re: objLoader 014 : now with VBO!
Reply #26 - Sep 6th, 2008, 4:35am
 
Hi polymonkey.

I am trying to use your obj loader.  I thought I was supposed to put it in the libraries folder.  However, processing does not seem to be able to find it.

I have also tried sgsrules's loader.  It works well.  I am trying to see which suits my needs better, but I am thinking that polymonky's has more options.
Re: objLoader 014 : now with VBO!
Reply #27 - Sep 11th, 2008, 10:51am
 
hello.
first question: i started using sgsrules's objloader and it works like a charm (great speed!).. many, many thanks for it. anyway, i know there have been some dramatic (big word, but true) changes in opengl as from processing 144 and therefore i noticed the textures are displayed kinda' different, as in 148 are displayed upside down and in 135 correctly. i solved this by loading the texture as PImage, rotating it and then creating an ImageBuffer from it with the setRGB(x, y, color) function, then binding it on the object loaded with the objloader. while this works, i think that there is a setting in opengl that deals with an option of automatically rotating textures when binding them on objects. how can i access it? (if i can).

second question: you probably figured I'm not so experienced in opengl in java. therefore i ask: some exported obj files contain more objects with different textures each. in sgsrules's example, we bind a texture to the whole obj file. how can i bind different textures to different objects? (they are specified in the obj file).

thank you in advance.
Re: objLoader 014 : now with VBO!
Reply #28 - Sep 11th, 2008, 11:12am
 
ive noticed some changes in different processing versions too. like for example in 148 my textures were inverted. i havent read the changelog but maybe they changed it..

you dont have to load pimage, rotate and all that, just flip your texture coordinates in y axis

like:

V' = 1.0 - V

as for loading multiple textures.. i believe they read material files. if that is true just create your material files and let the loaders do their work.. if they dont, load your images and apply them manually to each object. you should know which object and which texture.. yea its not practical for that should be the way to go now, unless u want to write material support yourself. or convince them to do it, in case they didnt already
Re: objLoader 014 : now with VBO!
Reply #29 - Sep 11th, 2008, 12:14pm
 
thank's very much for the reply, texturing problem solved (such a n00b i are).
now, i know about mtl and i just export a 3ds file with meshLab (open source) into an obj and all the work is done for me, so at least this is easy Smiley i was talking about sgsrules's objloader, because it doesn't really seem to load anything from a mtl as far as i understand it (it doesn't really need it). i have to load/bind the texture myself and the only code i know is to bind it to the whole geometry of the imported obj file. now, how can i bind it to separate elements of the obj?
Pages: 1 2 3