0

My team is building an augmented reality chemistry app.

We have successfully imported a 3D mesh of a molecule from wolfram mathematica using a special library...however, the way we are doing it only imports the mesh -- there are no colors on the molecule that show which elements are which, like this - enter image description here

Is there some way to either:

  1. Get skins for chemical elements/compounds dynamically with an API or save them as assets?

  2. Be able to consistently identify the order of the spheres in Unity3D and map the proper color to it using JSON data I know I can get of the location/order of elements in the compound?

  3. Some other way I haven't thought of, or a mix of the two above?

Thank you for any help.

David
  • 15,894
  • 22
  • 55
  • 66
kodiak3
  • 45
  • 5
  • What is the format of the source mesh from Mathematica? I mean how did you imported it? I am curious about this because in your second solution "Be able to consistently identify the order of the spheres in Unity3D..." seems to suggest that you do not know the mapping between each vertex of your imported mesh and a chemical element or bound between elements. If you cannot import such information from Mathematica, maybe assemble your own model in Unity directly from the chemical structural formula would be more promising? – YAC Jan 06 '18 at 01:07

1 Answers1

0

You can try filling in the Mesh colors by using Mesh.SetColors in script. This will store a color for each vertex in the mesh data. I am not sure how you are processing your mesh data, but I am assuming you are already using a script to do this. Make sure you assign a material with a shader that actually reads and displays the vertex color to the screen

SergioVA
  • 21
  • 3