Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4810

Re: Problem loading 3d models

From Roger Bagula <roger.bagula@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Problem loading 3d models
Date 2011-09-07 09:39 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j47e3k$kud$1@smc.vnet.net> (permalink)
References <j44k27$93q$1@smc.vnet.net>

Show all headers | View raw


On Sep 6, 1:02 am, Roger Bagula <roger.bag...@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]

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Problem loading 3d models Roger Bagula <roger.bagula@gmail.com> - 2011-09-06 08:02 +0000
  Re: Problem loading 3d models Roger Bagula <roger.bagula@gmail.com> - 2011-09-07 09:39 +0000
  Re: Problem loading 3d models Yves Klett <yves.klett@googlemail.com> - 2011-09-07 09:48 +0000

csiph-web