POV-Ray : Newsgroups : povray.general : Pov 2.2 and Crossroads : Re: Pov 2.2 and Crossroads Server Time
3 Aug 2024 16:24:28 EDT (-0400)
  Re: Pov 2.2 and Crossroads  
From: nathen watson
Date: 1 Jan 2004 19:59:49
Message: <3ff4c285@news.povray.org>
Im not sure if the word "export" is the right word to use for what my macros
do. However, here is an explanation of what they do.

The idea is pretty simple. There are three ways to 'export' shapes that I
tried. The first way that I tried was very inefficient and produced lots of
redundant vertexes. It is as follows: Write a macro that creates a mesh
shape, such as a cylinder. (The mesh object that the macro creates is not
actually seen in the SDL file)  Every triangle has 3 corners. As the macro
creates the first triangle of that mesh cylinder, write out 3 vertexes to a
.OBJ file, corresponding to the corners of that triangle.
for example,
when the macro makes:   triangle {<-1, 0, 0>, <1, 0, 0>, <0, 1, 0>}
write out in the .OBJ file:

                v   -1    0    0
                v    1    0    0
                v    0    1    0

Then connect those 3 vertexes with a face in the .OBJ file.
i.e:           f   1   2   3

Do the same with the next triangle and continue this process until the macro
finishes.

The second way that I tried was more efficient. Write a macro that displays
a POV primative, such as a sphere, as a marker for the corresponding .OBJ
mesh object. Then in that same macro, write out vertexes and faces, to an
.OBJ file, which creates a .OBJ mesh sphere with the same scale, and
transforms as the POV primative.


The third way that I tried was sort of a combination of both ways explained
above. Write a macro that generates and displays a POV mesh shape, that is
used as a marker for the corresponding .OBJ mesh shape. Then in that same
macro write out vertexes and faces, to the .OBJ file, which creates a .OBJ
mesh shape, with the same scale and transforms as the POV mesh shape.

After the POV macros write out the .OBJ file, open that file with Poseray to
view the shape, and possibly clean up the model.

Even if this process is not technically "exporting", it still has the same
result. I can use POV, and Poseray, to create shapes, which I can render in
other rendering packages.

Hope this was helpful.

Nathen Watson

"Warp" <war### [at] tagpovrayorg> wrote in message
news:3ff4af81@news.povray.org...
> nathen watson <nxw### [at] volcanonet> wrote:
> > POV 3.5 does has the ability to export triangle meshes to other formats,
if
> > you write macros to do it.
>
>   I would be surprised if this was so because AFAIK there's no way of
> getting information about a mesh in POV-Ray. (I once made a patch for
> this purpose, but it kind of died because the tesselation patch which
> was the main idea in that patch didn't quite work well.)
>
>   However, you can use eg. the triangle mesh compressor program to
> convert a POV-Ray mesh or mesh2 (at least with the new version 3 beta)
> to PCM format which is easily readable in POV-Ray, and you can use that
> info to export to almost any other (ascii) format with a proper POV-Ray
> SDL script.
>
>   (The original idea of the PCM format was that it was much smaller than
> the mesh format (mesh2 didn't yet exist back when PCM was developed), but
> currently the PCM format is more handy for making pov-scripts which make
> all kinds of handy operations to meshes, such as deformations,
hair-growing,
> subsurface division, exporting to other formats...)
>
> --
> #macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb
x]
> [1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
> -1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// -
Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.