Colors are lost in U3D file

All about the Viewer VR.
Post Reply
Joe
Posts: 61
Joined: Fri 11. Jul 2008, 19:29

Colors are lost in U3D file

Post by Joe » Wed 10. Sep 2008, 19:44

Hi,
I have displayed a scene graph (a colored cube from the tutorials) in the ViewerApp and I exported it into a U3D file. After putting the U3D container into a PDF file, the colors are gone and the model is blue. I inserted the U3D file with pdfLaTeX an iText, to be sure, that not the PDF insertion removes the colors. I think the colors are not exported, are they?

Many thanks and best regards, Joe

sechel
Posts: 69
Joined: Tue 2. Oct 2007, 09:20

Color Attributes

Post by sechel » Fri 19. Sep 2008, 10:40

Hi Joe,
at the moment only the colors of the appearance (ambient, diffuse, specular,...) are exported. Color attributes like face or vertex colors are omitted. Sorry for this, but there is a lot of conversation needed to correctly export the color attributes. I will definitely implement this but it will take some time.

Stefan

gehricht
Posts: 5
Joined: Sun 7. Jun 2009, 17:39

Re: Colors are lost in U3D file

Post by gehricht » Sun 7. Jun 2009, 17:47

Has there been any progress made? As far as I know, there is no freeware-solution for exporting to u3d...Without the colours, it is not very useful :-( I guess, a lot of people would be very, very happy (including myself), if exporting would work properly. 3d-objects could be a nice enhancement of presentations!!!
With thanks
Yours Wolfgang

sechel
Posts: 69
Joined: Tue 2. Oct 2007, 09:20

Re: Colors are lost in U3D file

Post by sechel » Mon 8. Jun 2009, 09:04

Hi Wolfgang,
unfortunately there havn't been any changes in the U3D writer since some time now. I plan to work on it in the near future but right now we are quite busy getting a new release of jreality ready.
If this color feature is urgent then you could have a look into the source code. Maybe it is not as difficult as I thought.
Stefan

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: Colors are lost in U3D file

Post by steffen » Mon 8. Jun 2009, 17:26

As far as I know, there is no freeware-solution for exporting to u3d...Without the colours, it is not very useful :-(
This applys only for vertex/face/edge colors. The color of an object as well as its texture will be exported, so I think it isnt that useless... But exporting at least vertex colors is still an important feature we need to implement...

gehricht
Posts: 5
Joined: Sun 7. Jun 2009, 17:39

Re: Colors are lost in U3D file

Post by gehricht » Tue 9. Jun 2009, 10:10

steffen wrote: I think it isnt that useless...
Sorry, for my harsh statement.
steffen wrote: The color of an object as well as its texture will be exported
Interesting. I intend to use jReality basically for exporting structures from Mathematica to u3d. Do you think that there is a chance of preserving colors?
Suppose I have in Mathematica something like

Export["./1.jvx",
Graphics3D[
GraphicsComplex[{{0, 0, 0}, {0, 2, 0}}, {{Green, Sphere[1]}, {Red,
Sphere[2, 0.4]}, {Blue, Cylinder[{1, 2}, 0.2]}}]]]

Is there a way to get this to u3d (with the corresponding colors)?
I am aware that this might be now too specific but I really would appreciate any hint/help.
With thanks
Yours Wolfgang

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: Colors are lost in U3D file

Post by steffen » Tue 9. Jun 2009, 11:23

It works when you do not export to jvx first. Just create a Graphics3D and write that to a file ending with .m

gfx = Graphics3D[
GraphicsComplex[{{0, 0, 0}, {0, 2, 0}}, {{Green, Sphere[1]}, {Red,
Sphere[2, 0.4]}, {Blue, Cylinder[{1, 2}, 0.2]}}]]
gfx >> 1.m

Then load the with the ViewerApp (http://www3.math.tu-berlin.de/jreality/ ... erApp.jnlp), and follow the instructions in
http://www3.math.tu-berlin.de/jreality/ ... _U3D_files to create a PDF.

I have used Mathematica 6, maybe there are problems with other versions...

See the attached PDF (had to zip it, uploading pdf is not possible...)
Attachments
1.zip
(16.8 KiB) Downloaded 364 times

gehricht
Posts: 5
Joined: Sun 7. Jun 2009, 17:39

Re: Colors are lost in U3D file

Post by gehricht » Tue 9. Jun 2009, 14:30

steffen wrote: See the attached PDF (had to zip it, uploading pdf is not possible...)
That's quite impressive! Thank you! May I ask, how does it comes that your reader understands mathematica-syntax?
With thanks
Yours Wolfgang

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: Colors are lost in U3D file

Post by steffen » Tue 9. Jun 2009, 15:48

May I ask, how does it comes that your reader understands mathematica-syntax?
Well, we had a clever student who wrote the parser ;-) But please do not expect that it supports all features of Graphics3D, and note that there may be significant changes in the format for different versions of Mathematica, so the next version might break our parser again...

gehricht
Posts: 5
Joined: Sun 7. Jun 2009, 17:39

Re: Colors are lost in U3D file

Post by gehricht » Tue 9. Jun 2009, 18:07

steffen wrote: But please do not expect that it supports all features of Graphics3D
Unfortunately, in my case this might be still the bottleneck... However, it is a real improvement that I don't see everything 'blue' anymore!

With thanks
Yours Wolfgang

sechel
Posts: 69
Joined: Tue 2. Oct 2007, 09:20

Re: Colors are lost in U3D file

Post by sechel » Thu 18. Mar 2010, 11:53

Hello finally the u3d update has arrived.
Vertex, edge and face colors are now exported. However there are some things to note:
- The adobe renderer does not overwrite the material properties by the node colors as jreality does.
- Point and line sets are correctly exported to u3d but not yet implemented by the adobe reader,
use tubes and spheres instead. These will have the correct colors then.
- vertex colors have priority over face color attributes. U3D cannot have both.
- the behaviour of the jogl renderer with flat shaded vertex colors cannot be reproduced in u3d.
Please check if you can use these features with your geometry.
sechel

gehricht
Posts: 5
Joined: Sun 7. Jun 2009, 17:39

Re: Colors are lost in U3D file

Post by gehricht » Thu 29. Apr 2010, 09:58

Thanks for the update! I will look into it!
With thanks
Yours Wolfgang

Post Reply