File:Still life in Mathematica.png
Summary
| Description |
English: An example of 3D graphics created with a short script written in Wolfram Language and rendered using Mathematica. Čeština: Příklad 3D grafiky vytvořené krátkým skriptem napsaným ve Wolfram Language a renderované v Mathematice. |
| Date | |
| Source | Own work |
| Author | JozumBjada |
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Source code
This image was created using Wolfram language 13.1.0 for Linux x86 (64-bit) (June 16, 2022). The source code follows.
lights = {DirectionalLight[Yellow, {{0,-1,0}, {0,0,0}}], PointLight[Yellow, {-1.2,.2,.2}, {0,0,5}]};
wood = ImageMultiply[ExampleData[{"Texture", "Bark"}], Brown];
table = {MaterialShading[<|"BaseColor" -> Texture[wood]|>], Cuboid[-1/2{1,1,.1}, 1/2{1,1,.1}]};
leg = Translate[Scale[table, {.2,.2,10}], {.2,-.2,-.5}];
cloth = {MaterialShading[{"Satin",Red}], Polygon[1/2{{.8,1,.11}, {-1,1,.11}, {-1,-1,.11}, {.3,-1,.11}}]};
drapery = Plot3D[.01 Sin[6\[Pi] x] Log[1+5 y], {x,0,1}, {y,0,1}, PlotStyle->MaterialShading[{"Satin",Red}], Mesh->None, Lighting->lights];
drapery = First@Cases[InputForm[drapery], _GraphicsComplex, Infinity, 1];
drapery = Rotate[Translate[drapery, {-.5,-.5,0}], -\[Pi]/2, {1,0,0}, {-.5,-.5,0}];
drapery = Translate[Scale[drapery, {.65,1,1}, {-.5,-.5,0}], {0,-.01,.06}];
vasefun = Interpolation[BSplineFunction[{{0,.5}, {1,1.5}, {2,.1}, {2.3,.1}, {3,.7}}] /@ Range[0, 1, .1]];
vase = RevolutionPlot3D[vasefun[x], {x,0,3}, RevolutionAxis->{1,0,0}, PlotStyle->{Thickness[.2], MaterialShading["Gold"]}, Mesh->False, Lighting->lights];
vase = First@Cases[InputForm[vase], _GraphicsComplex, Infinity, 1];
vase = Translate[Rotate[Scale[vase, .2, {0,0,0}], -\[Pi]/2, {0,1,0}], {.1,.1,.06}];
gr = Graphics3D[{EdgeForm[], table, leg, drapery, cloth, vase}, Lighting->lights, Boxed->False];
gr = Graphics[{RadialGradientFilling[{Darker@Orange, Black}, ImageScaled[{.5,.7}]], Rectangle[-{1,1}, {1,1}], Inset[gr, {0,0}, ImageScaled[{.5,.5}], 2.1]}, PlotRange->{{-.8,.8}, {-.7,1}}]