我试图在鼠尾草中绘制一个隐式定义的陀螺表面。但是,我在表面上反射的光源看起来不太好。如何更改3d图的灯光设置?
我尝试为我的表面设置不同的纹理属性,但更改未显示任何结果。我还尝试设置光源,但也没有进行任何更改。
x, y, z = var('x,y,z')
def phi_g(x,y,z):
X=x+pi/2
Y=y+pi/2
Z=z+pi/2
return sin(X)*cos(Y)+sin(Y)*cos(Z)+sin(Z)*cos(X)
G1=implicit_plot3d(phi_g(x,y,z)==0.02, (x,0,2*pi), (y,0,2*pi), (z,0,2*pi),color='blue', frame=False, plot_points=80)
G2=implicit_plot3d(phi_g(x,y,z)==-0.02, (x,0,2*pi), (y,0,2*pi), (z,0,2*pi),color='red', frame=False, plot_points=80)
C=cube(center=(pi, pi, pi), size=2*pi, color='grey', opacity=0.1)
G=G1+G2+C
plot_G=G.plot()
plot_G.save('g.png',figsize=20,zoom=1.27)
我希望输出的光源在表面上没有任何反射。
答案 0 :(得分:1)
我并没有真正使用它,但是Sage中的I think the Tachyon ray-tracer可以满足您的需求。我不知道» npm install --global sass
/usr/local/bin/sass -> /usr/local/lib/node_modules/sass/sass.js
> fsevents@2.0.7 install /usr/local/lib/node_modules/sass/node_modules/fsevents
> node-gyp rebuild
gyp: binding.gyp not found (cwd: /usr/local/lib/node_modules/sass/node_modules/fsevents) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at ChildProcess.emit (events.js:200:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/sass/node_modules/fsevents
gyp ERR! node -v v12.4.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 (node_modules/sass/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.0.7 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
是否在默认查看器中完全支持这些功能。