POV-Ray : Newsgroups : povray.general : Help - using rgb colors with triangles : Re: Help - using rgb colors with triangles Server Time
11 Aug 2024 23:17:25 EDT (-0400)
  Re: Help - using rgb colors with triangles  
From: David Arcoleo
Date: 20 Jun 1999 13:57:34
Message: <376D2B87.2DDDE7B@njmedicine.com>
>   Exactly how many colors do you expect you will have to produce to
> match mathmatica's colors in the conversion. If you are talking less
> than say 50 - 100 individual colors or so it might be worth your
> effort to write a sorting routine that places the triangles of a
> given color each into it's own mesh object. This way you need only
> add a pigment to each group of triangles as opposed to every triangle
> you produce.

Well, in thinking over the problem, I have think that assigning a
seperate color to each
triangle would be too massive.  This is my situation -

I am writing a utility to convert Mathematica images to povray. 
Mathematica's use of lighting is not the same as povray's and converting
it is kindof a pain.  Also, there isn't a whole lot of documentation on
the subject.  Therefor, I thought that grabbing the color from each
triangle would be the easiest.  It's easy enough for me to grab the
color, but if the trade off is such a huge file, then it's not worth it
to me.  For my utility, I have to consider the following -

1.  Time it takes Mathematica to generate the image itself - .02 seconds
2.  Time it takes for my MathLink program to grab the data from
Mathematica - .5 seconds
3.  Time it takes for my program to generate a povray file from it - 6
seconds
4. Time it takes for povray to render the image - 9 seconds

This is on a K6/2-266, 64 megs ram, running Winnt 4, Mathematica 4.0,
Mathlink 7, and vc5, and povray 3.1 (320x20)

At present, my program only generates povray files for surfacegraphics,
which means I only have to send z values across mathlink.  I'm adding 3d
graphics, which will mean that it has to send x, y, and z values.  This
triple the mathlink time, but add nothing to the povray generation and
mathematica generation time.  if however, I have to send <x, y, z> AND
<r, g, b>, then the 
mathematica time will remain the same, the mathlink time will increase
six-fold, the povray
file size will double, and the generation time will surely double. (at
least).

I think, therefor, that the best solution is to spend more time trying
to mimick Mathematica's behaviour in povray.  These timing will become
critical later, as the number of points that I'm dealing with grows to
upwards of 1 million and i'm generating povray images in 1280x1024. 
This  brings me to the next question - has anyone ever used
Mathematica?  I'm really bad at two major things - copying viewpoints
and lighting.  I can't seem to get them to correspond. This is of course
because I'm not a graphics person at all so I have no experience this
this aspect of mathematica programming, or any graphics backage for that
matter.

Thank you all for your support in this.

-Dave


Post a reply to this message

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