Colors are lost in U3D file
Colors are lost in U3D file
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
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
Color Attributes
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
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
Re: Colors are lost in U3D file
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
With thanks
Yours Wolfgang
Re: Colors are lost in U3D file
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
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
Re: Colors are lost in U3D file
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...As far as I know, there is no freeware-solution for exporting to u3d...Without the colours, it is not very useful :-(
Re: Colors are lost in U3D file
Sorry, for my harsh statement.steffen wrote: I think it isnt that useless...
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?steffen wrote: The color of an object as well as its texture will be exported
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
Re: Colors are lost in U3D file
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...)
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
Re: Colors are lost in U3D file
That's quite impressive! Thank you! May I ask, how does it comes that your reader understands mathematica-syntax?steffen wrote: See the attached PDF (had to zip it, uploading pdf is not possible...)
With thanks
Yours Wolfgang
Re: Colors are lost in U3D file
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...May I ask, how does it comes that your reader understands mathematica-syntax?
Re: Colors are lost in U3D file
Unfortunately, in my case this might be still the bottleneck... However, it is a real improvement that I don't see everything 'blue' anymore!steffen wrote: But please do not expect that it supports all features of Graphics3D
With thanks
Yours Wolfgang
Re: Colors are lost in U3D file
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
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
Re: Colors are lost in U3D file
Thanks for the update! I will look into it!
With thanks
Yours Wolfgang
With thanks
Yours Wolfgang