modifying imported 3ds model

hello

i hope this is the right place for this question. if not - please delete this thread :slight_smile:

i have a simple jogl app in which i import 3ds model. everything works fine, but i need to change some of the properties of the model, for example vertices color. how can i do that?

is it possible to edit/modify imported 3ds model on a vertex level?

if not then how can i achieve this? import the model into VBO or DL?

What are you using to import the 3ds model? jogl is (mostly) a GL wrapper; GL doesn’t know about obj or 3ds or any other model format. If you have a model loader (such as the one from the demos), then you can modify the data in the vertex handling in that importer.

i use ThreeDS model loader from joglutils package. it seems that there’s no vertex handling tools there.

maybe vrml would be better? is there a way to import vertex data from vrml to display list? i mean some library or something, i know i could write my own :wink:

hmm… maybe i wasn’t very precise, so let me explain:

i need to:

  1. export model from 3ds max
  2. import it into jogl app
  3. modify the color of vertices

how can i do that?

looks like i’ll need to fallback to VRML and parse it myself :confused:

I’m assuming you’re just using the MyModel functionality to have it automatically render? If you’re doing this, then you can’t modify the vertex colors because the ThreeDS package doesn’t allow for that in their data model. What you could do is write your own simple renderer to render the information stored in a Model3DS object. This shouldn’t be that hard at all. And during the process of rendering, you’re probably going to be turning that data into a more jogl friendly version which should let you then easily pass vertex colors as well. I would recommend turning all of the data in the Model3DS object into the necessary vertex arrays (ie vertices, normals, and texture coordinates). All of these could be taken from that object, then you could just create a color vertex array of the write size and modify it’s contents, bind and enable it when rendering the model as well, and you’re basically set. Keep in mind setting up the contents of vertex arrays is a little tricky depending on how you render it (either glDrawElements or glDrawArrays).

thanks for the info :slight_smile:
that’s true, i was using MyModel.
turning all of the 3ds data into vertex arrays sounds promising, but how can i do that?
now, finally we get to the core of the problem: accessing raw vertex data from 3ds model file :slight_smile:

if i understand you correctly, i can take out vertex data from object. but how?

if you can export the models as .ASE format I found it a bit easier

indeed, ASE format seems to be quite straightforward. i might try it.
i have found ASE loader, but it is designed for use with java3d, not jogl.
do you know any object loader designed for jogl?

oh, nevermind, i have written ASE parser myself :slight_smile:
anyway, thanks for your answers.

cheers