help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave and 3-D shapes/meshes


From: Jeff Abrahamson
Subject: Re: octave and 3-D shapes/meshes
Date: Tue, 18 Oct 2005 15:53:03 -0400
User-agent: Mutt/1.5.9i

On Tue, Oct 18, 2005 at 01:42:24AM -0400, Etienne Grossmann wrote:
>   Hi Jeff,
> 
> maybe, in this case, vrml is apropriate: source forge has
> vrml_faces, vrml_surf, vrml_browse and vmesh functions. I think the
> 1st will do what you want. If you have freewrl installed, you can use
> vrml_browse to visualise your vrml object and take snapshots w the s
> key. 

That looks very cool, thanks.  I compiled it (I miss autoconf).  I
already got to submit a bug report, as it crashed on several of the
test shapes. :(

But sometimes it works, so I made myself a triangulated cube and
called vrml_faces and got the following bit of vrml, which I passed to
vrml_browse.  FreeWRL came up and showed a black screen (plus status
text).  Am I doing something wrong?

  octave:5> vrml
  vrml = Shape {
    appearance Appearance {
              material  Material {
                diffuseColor       0.3      0.4      0.9
            }
    }
    geometry IndexedFaceSet {
      solid FALSE     # Show back of faces too
      convex FALSE
      coordIndex [
  0, 1, 3, -1, 0, 3, 2, -1, 2, 3, 5, -1, 2, 5, 4, -1, 4, 5, 7, -1, 4, 7, 6, -1, 
6, 7, 1, -1, 6, 1, 0, -1, 1, 7, 5, -1, 1, 5, 3, -1, 6, 0, 2, -1, 6, 2, 4, -1, ]
      coord  Coordinate {
        point [
                     -0.500   -0.500    0.500,
                      0.500   -0.500    0.500,
                     -0.500    0.500    0.500,
                      0.500    0.500    0.500,
                     -0.500    0.500   -0.500,
                      0.500    0.500   -0.500,
                     -0.500   -0.500   -0.500,
                      0.500   -0.500   -0.500,
  ]
      }
    }
  }

  octave:6>


BTW, this is how I called vrml_faces:

  octave:6> cube
  cube =
  {
    faces =

      1  1  3  3  5  5  7  7  2  2  7  7
      2  4  4  6  6  8  8  2  8  6  1  3
      4  3  6  5  8  7  2  1  6  4  3  5

    triangle_areas =

     Columns 1 through 8:

      0.50000  0.50000  0.50000  0.50000  0.50000  0.50000  0.50000  0.50000

     Columns 9 through 12:

      0.50000  0.50000  0.50000  0.50000

    verts =

     Columns 1 through 7:

      -0.50000   0.50000  -0.50000   0.50000  -0.50000   0.50000  -0.50000
      -0.50000  -0.50000   0.50000   0.50000   0.50000   0.50000  -0.50000
       0.50000   0.50000   0.50000   0.50000  -0.50000  -0.50000  -0.50000

     Column 8:

       0.50000
      -0.50000
      -0.50000

  }

  octave:7> vrml = vrml_faces(cube.verts, cube.faces)

-- 
 Jeff

 Jeff Abrahamson  <http://www.purple.com/jeff/>    +1 215/837-2287
 GPG fingerprint: 1A1A BA95 D082 A558 A276  63C6 16BF 8C4C 0D1D AE4B



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]