Daniel
Daniel

Reputation: 19547

Placing Several 3D Objects in Mathematica Together in the Same 3D Box

I have a 3D surface created by the ListPlot3D in mathematica. The surface itself is relatively planar and in the arbitrary plane xy. I would like to place this surface on top of a molecule either generated from the ChemicalData function or inputted from a .pdb or other molecule input. This molecule is also planar and placed again the in the xy plane. I would like these two 3D objects to be separated by some z distance.

The end hope is that I will have a potential energy surface placed above this planar molecule that will still be rotatable in 3D. I have been using the Show and Graphics 3D options to no success. The x,y points on the surface correspond to x,y points on the 3D molecule, however they can easily be scaled and shifted as needed. As an option of last resort I suppose I could input the x,y,z coordinates of the atoms and use the PointListPlot3D command with various options to mimic the look of the molecule but this seems to be much more complicated then it needs to be.

Another approach that could be possible is if both of the 3D objects are converted to 3D boxes and simply stacked on top of each other. However I have not found this functionality as of yet in mathematica. Does anyone have any ideas on how to do this?

PES = ListPlot3D[{{0., 0., -2.04900365`},..., {0., 0.3, -2.05743098`}}]
Show[Graphics3D[ChemicalData["Benzene","MoleculePlot"]],PES]

The issue was the scale of the molecule versus the scale of the energy surface.

The units, as best I can tell, are in picometers. However their atomic distance seem to be off by 3%.

As an update to this it became much simpler to take the xyz coordinate of the molecule and hand generate the objects. It has been some time but I believe if you only state:

ChemicalData["Benzene","MoleculePlot"]

Mathematica will show you the format. If you do many of these a fairly simple python script can be made.

Upvotes: 3

Views: 3913

Answers (2)

cormullion
cormullion

Reputation: 1672

ListPlot3D returns a Graphics3D object, so you should be able to combine it with other Graphics3D objects...

lp = ListPlot3D[  RandomReal[{}, {50, 3}], Mesh -> None];
sp = Graphics3D[Sphere[]];
Show[sp, lp, Boxed -> False]

a new gravatar

although getting everything the same size will be the challenge...

Upvotes: 5

Vitaliy Kaurov
Vitaliy Kaurov

Reputation: 1300

What Szabolcs said and I also did not get from your question why wouldn't something like this work?

    Show[Graphics3D[
  Rotate[ChemicalData["Caffeine", "MoleculePlot"][[1]], 
   45 Degree, {1, .5, 0}]], 
 Plot3D[-200 + 50 Sin[x*y/10000], {x, -100 Sqrt[3*Pi], 
   100 Sqrt[3*Pi]}, {y, -100 Sqrt[3*Pi], 100 Sqrt[3*Pi]}, 
  ColorFunction -> "TemperatureMap"], Axes -> True]

enter image description here

Upvotes: 10

Related Questions