Question

i am new to java 3d. i have encountered a situation like , i want to load ready made developed 3d model of any object [as an example shoe] developed in 3d modeling software like 3d studio max or Maya in my java program , update its texture or color properties etc. then render it and then display the updated model to the end user.

so i am asking all the 3d experts how should i proceed ahead to accomplish my goal ? which input should i load into my program ? how can i update the loaded model , render it and display the updated model to the end user ?

in simple story , i want to give my users ability to modify 3d model by their interactions as such , they provided 3d model of shoe for example in default colors and textures & some fields like sole color , if they choose color red then the loaded 3d model's sole is colored red (i.e. updated) and then displayed to end user with red color rubber sole shoe instead of default color shoe.

please, advice me to accomplish my goal.

Was it helpful?

Solution

Ok so first of all, complex objects are usually created using some 3D editing software like Blender or Art of Illusion. These programs can output the object into several different file formats, the most common being the .obj file format:

Another common format is .3ds, which in my experience is a lot more work than it's worth. They do make a .3ds file loader for Java3D, the page can be found here:

My advice for you is to just use the .obj file format, it is a lot easier to use. You can also just make your own parser for it which is not as hard as it sounds. This way you know exactly how your object is being loaded into the environment. Java does come with it's own parser, instructions on how to use it are here:

I have had a lot of trouble with files exported with Blender while using this file format unfortunately, they may have fixed the problem by now but I'm not sure. When I used to do a lot more 3D stuff I just used Art of Illusion, even know Blender is a lot more powerful. Blender can be run on a Mac but is a lot smoother on windows with the proper setup. Good luck! If you need some example code let me know and I would be more than happy to post some for you.

Art of Illusion:

Blender:

Im not sure how you want the user to be able to change the object. If you want them to be able to change the color, or the type of shoe or whatnot that is not a huge deal. If you want the user to be able to change the lace length or something where you are changing the actual object's structure, that requires an in depth knowledge of 3D structure. If you want to change a color, just change the material. If you want to be able to change the type of shoe, just load a different shoe object. I hope this was helpful for you.

In the comments, you also talk about texture mapping, which in my experience is a lot easier to do in Blender than it is to do in Art of Illusion. I would probably use blender to accomplish this:

John

OTHER TIPS

I assume you just want the user to select a different texture/color, right?

Then have a look at the Java3D tutorials out there, e.g. this one: http://www.java3d.org/tutorial.html

I further guess your shoe is actually a 2-part model, i.e. just the sole should get another color while the rest might get a different texture, right?

In that case, you'd need 2 models/shapes, each with its own appearance. Then, for example, alter the soles appearance as you like, e.g. by assigning a different material or changing the material's color.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top