POV-Ray : Newsgroups : povray.newusers : calculation for pixel normal value and color value in source code : calculation for pixel normal value and color value in source code Server Time
7 Jul 2024 08:27:17 EDT (-0400)
  calculation for pixel normal value and color value in source code  
From: Yunying
Date: 11 Feb 2010 05:45:02
Message: <web.4b73df795ff3978c25acb1ab0@news.povray.org>
Hi, I am a begineer for Pov-Ray. I am doing a school project which requires me
to use pov-ray to generate a picture which each pixel value actually represent
its normal value.

  My supervisor told me I can just replace the color value(R,G,B)of each pixel
by that pixel's normal value(x,y,z).(P.S. I have tried to use this method to
edit the tutorial example in 'Introduction to POV-Ray'(SDL Tutorial: A
raytracer, p.g. 176. and could get the normal_value picture I want).

  However, the tutorial I tried is only suitable for generating spheres, if I
want to generate a more complex picture, I don't know how to do. Do I need to
edit the source code? or anybody can tell me where I can find
the source code which calculate each pixel's color and its normal value? then I
can directly use the normal value to replace the color value. If you can, please
tell me the variable name used to represent these two variables? Please please
help!!! it's very important to me.

  Thank you very much!

P.s. I have got a reply from other group, but I cannot understand very well
about this, can any one explain it? Or have other suggestion?Is there a way
which I only need to edit one part of the code(e.g. source code), so I can use
it for all of the other model program without editing every program?

This is the reply suggestion from Warp, thanks for his/her help.

>>  You might be able to do that without having to modify the source code.

  Define three pigments, each using a slope_map oriented towards each of
the main axes, and each using one of the RGB components as its color map
(ie. the first would be from black to red, the second from black to green,
and so on). Then use the average of these pigments as your overall pigment
of the object.

--
                                                          - Warp
>>


Post a reply to this message

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