Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Problem loading 3d models

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121270] Re: Problem loading 3d models
  • From: Roger Bagula <roger.bagula at gmail.com>
  • Date: Wed, 7 Sep 2011 05:38:15 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j44k27$93q$1@smc.vnet.net>

On Sep 6, 1:02 am, Roger Bagula <roger.bag... at gmail.com> wrote:
> I'm also having problems with downloading Mathematica 3d Models:
> the Rabbit came through fine,
> but only that. I tried the shark and the zephlin too.
> I'm getting fractured results...
> Try:
>
> ExampleData["Geometry3D"]
> ExampleData["ColorTexture"]
> Clear[g0]
> g0 = ListSurfacePlot3D[
>   ExampleData[{"Geometry3D", "BassGuitar"}, "VertexData"],
>   Lighting -> "Neutral", MaxPlotPoints -> 50, Mesh -> None,
>   Axes -> False, Boxed -> False, PlotRange -> All,
>   PlotStyle -> {Brown, Specularity[White, 20],
>     Texture[ExampleData[{"ColorTexture", "BurlOak"}]]},
>   TextureCoordinateFunction -> (Normalize[{#1, #2, #3}] &)]
> Export["BassGuitarMathematica.3ds", g0]
> Export["BassGuitarMathematica.obj", g0]
> Import["BassGuitarMathematica.3ds"]

The models load as graphics fine,
 if you do it right:

Clear[t]
t = ExampleData["Geometry3D"]
g = Table[ExampleData[t[[n]]], {n, 1, Length[t]}]

Two things:
The models in "Geometry3D" have mostly more than just "VertexData"
so  ListSurfacePlot3D[] fails.
Here is away to see the other data:
ExampleData[{"Geometry3D", "SpaceShuttle"}, "GraphicsComplex"]
Creating big tables of vertex data can get some 3d graphics
"visible" to model programs but it costs a lot of memory:

Clear[f, g, h, k, s0, ff, ll, kk, mm, a, g3, ga, x]
f[x_] := 0 /; 0 <= x <= 1/8
f[x_] := 1 /; 1/8 < x <= 2/8
f[x_] := -1 /; 2/8 < x <= 3/8
f[x_] := 0 /; 3/8 < x <= 4/8
f[x_] := 1 /; 4/8 < x <= 5/8
f[x_] := 0 /; 5/8 < x <= 6/8
f[x_] := 0 /; 6/8 < x <= 7/8
f[x_] := -1 /; 7/8 < x <= 1
ff[x_] = f[Mod[Abs[x], 1]]
Plot[ff[x], {x, 0, 4}]
s0 = Log[2]/Log[3]
kk[x_] = Sum[ff[3^k*x]/3^(s0*k), {k, 0, 20}];
Plot[kk[x], {x, 0, 4}]
s0 = Log[2]/Log[3]
ll[x_] = Sum[ff[3^k*(x + 1/2)]/3^(s0*k), {k, 0, 20}];
Plot[ll[x], {x, 0, 4}]
a = Table[{ll[n/10000], kk[n/10000]}, {n, 1, 10000}];
ListPlot[a]
mm[x_] = Sum[ff[3^k*(x - 1/2)]/3^(s0*k), {k, 0, 20}];
digits = 50000
g3 = Table[{ll[n/digits], kk[n/digits], mm[n/digits]}, {n, 1,
digits}];
ga = ListSurfacePlot3D[g3, MaxPlotPoints -> 500,
  Lighting -> "Neutral", Mesh -> None, Axes -> False, Boxed -> False,
  PlotStyle -> {Cyan, Specularity[White, 20],
    Texture[ExampleData[{"ColorTexture", "StoneWall"}]]},
  TextureCoordinateFunction -> (Normalize[{#1, #2, #3}] &)]
Export["graycode3d.3ds", ga]




  • Prev by Date: Re: How to generate report with Mathematica script from command line (no front end)
  • Next by Date: Re: Quit versus Clear["Global`*"]
  • Previous by thread: Re: Problem loading 3d models
  • Next by thread: Maximum likelihood estimatior