How do you get custom 3D graphics to display properly in Mathematica?

时间秒杀一切 提交于 2019-12-18 16:52:30

问题


I need to incorporate a 3D model of the Earth into a satellite orbit intercept simulation I have created in Mathematica (I need it to work with "Graphics3D[]). I have downloaded several different models in formats that Mathematica claims to support and I even created my own in Pro/E. The ones that actually do get imported into the program (using "Import[]") lose their surface image and I am left with a generic sphere. How can I get custom 3D graphics to import correctly into Mathematica? Are certain formats better than others? (I have been using mostly CAD models) And is there place to download more (user-created) 3D graphics for Mathematica?

I know it's possible because Belisarius has done so in a response to a question here: How to create 2D (3D) animation in Wolfram Mathematica with the camera following the object? which is almost exactly what I need to do, as far as views go.


回答1:


myEarth = 
 ParametricPlot3D[{Cos@u Sin@v, Sin@u Sin@v, Cos@v}, {u, 0, 2 Pi}, {v, 0, Pi}, 
   Mesh -> None, TextureCoordinateFunction -> ({#4, 1 - #5} &), 
   PlotStyle -> Texture[Show[map, ImageSize -> 1000]]];  

a = {-1, 1};
Animate[
 Show[
  Graphics3D[Sphere[{0, 0, 0}, .5], 
   ViewPoint -> 3.5 {Cos@t, Sin@t, 0}, SphericalRegion -> True, 
   PlotRange -> {a, a, a}, Axes -> False, Boxed -> False],
   myEarth], 
{t, 0, 2 Pi}]

Edit

I found from where I borrowed some code: http://reference.wolfram.com/mathematica/ref/Texture.html Under Applications, Earth Texture



来源:https://stackoverflow.com/questions/5603281/how-do-you-get-custom-3d-graphics-to-display-properly-in-mathematica

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!