POV-Ray : Newsgroups : povray.programming : Are there documents for the source code? Server Time
9 Dec 2024 14:53:03 EST (-0500)
  Are there documents for the source code? (Message 1 to 8 of 8)  
From: Simon
Subject: Are there documents for the source code?
Date: 1 Jul 2013 23:10:00
Message: <web.51d243a492d8f63ce6ccd8f40@news.povray.org>
I've been reading the source code 3.7 beta for almost two weeks...
and it's really hard for me to read because there is nearly no comment to
explain how the code works, so is there any chance that I can get some documents
for the source code?

p.s. I want to use the source code for my own interest, no business profit
related.


Post a reply to this message

From: Le Forgeron
Subject: Re: Are there documents for the source code?
Date: 2 Jul 2013 03:51:34
Message: <51d28686$1@news.povray.org>
Le 02/07/2013 05:06, Simon nous fit lire :
> I've been reading the source code 3.7 beta for almost two weeks...
> and it's really hard for me to read because there is nearly no comment to
> explain how the code works, so is there any chance that I can get some documents
> for the source code?
> 
> p.s. I want to use the source code for my own interest, no business profit
> related.
> 
> 
Which part are you interested in ?

It is a far more easy to understand with the 3.1g source (far more C
oriented, despite being already very object oriented, without
multi-threading and message passing, but also with all sources flat IIRC)

common sources are in source/, but gluing code is in vfe/ and unix/ (for
the unix port)

p.s.: check the licenses.
p.s.2: current code is 3.7RC7, not beta anymore.


Post a reply to this message

From: Simon
Subject: Re: Are there documents for the source code?
Date: 4 Jul 2013 03:10:03
Message: <web.51d51e9b3349a570e6ccd8f40@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 02/07/2013 05:06, Simon nous fit lire :
> > I've been reading the source code 3.7 beta for almost two weeks...
> > and it's really hard for me to read because there is nearly no comment to
> > explain how the code works, so is there any chance that I can get some documents
> > for the source code?
> >
> > p.s. I want to use the source code for my own interest, no business profit
> > related.
> >
> >
> Which part are you interested in ?
>
> It is a far more easy to understand with the 3.1g source (far more C
> oriented, despite being already very object oriented, without
> multi-threading and message passing, but also with all sources flat IIRC)
>
> common sources are in source/, but gluing code is in vfe/ and unix/ (for
> the unix port)
>
> p.s.: check the licenses.
> p.s.2: current code is 3.7RC7, not beta anymore.

Hello Forgeron, Thanks for your advice!

My purpose is to get a map file which can show a link between the 2D coordinate
of the result image and the 3D coordinate that is described in the POV file.

I want to fulfill this purpose by modificate the source code of POV-Ray, is it
possible to do it in this way? Can you give me any advice on this idea?

And I want to read the document for this part of the source code.

I followed your advice to read the source code of the 3.1g version, but I didn't
build it successfully...

Thanks again!


Post a reply to this message

From: Le Forgeron
Subject: Re: Are there documents for the source code?
Date: 4 Jul 2013 04:02:42
Message: <51d52c22$1@news.povray.org>
Le 04/07/2013 09:04, Simon nous fit lire :
> My purpose is to get a map file which can show a link between the 2D coordinate
> of the result image and the 3D coordinate that is described in the POV file.
> 
> I want to fulfill this purpose by modificate the source code of POV-Ray, is it
> possible to do it in this way? Can you give me any advice on this idea?

So, basically you are interested in the camera code
(TracePixel::CreateCameraRay in tracepixel.cpp) which create a Ray (3D
origin with 3D direction) from the position in the final picture.
(unless you want to also have the reflection and refraction, at which
point it become to be harder)

Be aware that there is more than one camera's type, each with its own
mapping.

Documentation (for user, not programmer) of cameras can be seen at
http://wiki.povray.org/content/Reference:Camera


Post a reply to this message

From: scott
Subject: Re: Are there documents for the source code?
Date: 4 Jul 2013 06:16:13
Message: <51d54b6d$1@news.povray.org>
> My purpose is to get a map file which can show a link between the 2D coordinate
> of the result image and the 3D coordinate that is described in the POV file.
>
> I want to fulfill this purpose by modificate the source code of POV-Ray, is it
> possible to do it in this way? Can you give me any advice on this idea?

It should be possible without modifying the source. You know the ray 
direction for each pixel, the only piece of information you are missing 
is the depth. This can be found by either using megapov (IIRC) to output 
the depth image, or using a special gradient texture in the standard POV 
that will output a colour depending on the depth.

Unless you are familiar with the POV source (or want to become familiar) 
then I'd say the above option will be easier to implement.


Post a reply to this message

From: Simon
Subject: Re: Are there documents for the source code?
Date: 6 Jul 2013 07:45:01
Message: <web.51d8023a3349a570e6ccd8f40@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 04/07/2013 09:04, Simon nous fit lire :
> > My purpose is to get a map file which can show a link between the 2D coordinate
> > of the result image and the 3D coordinate that is described in the POV file.
> >
> > I want to fulfill this purpose by modificate the source code of POV-Ray, is it
> > possible to do it in this way? Can you give me any advice on this idea?
>
> So, basically you are interested in the camera code
> (TracePixel::CreateCameraRay in tracepixel.cpp) which create a Ray (3D
> origin with 3D direction) from the position in the final picture.
> (unless you want to also have the reflection and refraction, at which
> point it become to be harder)
>
> Be aware that there is more than one camera's type, each with its own
> mapping.
>
> Documentation (for user, not programmer) of cameras can be seen at
> http://wiki.povray.org/content/Reference:Camera


Hello Forgeron,
I followed your advice and finally I got the code I need, just want to say thank
you! really appreciate your help!


Post a reply to this message

From: Simon
Subject: Re: Are there documents for the source code?
Date: 8 Sep 2014 12:05:00
Message: <web.540dd3003349a57027287d6c0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 04/07/2013 09:04, Simon nous fit lire :
> > My purpose is to get a map file which can show a link between the 2D coordinate
> > of the result image and the 3D coordinate that is described in the POV file.
> >
> > I want to fulfill this purpose by modificate the source code of POV-Ray, is it
> > possible to do it in this way? Can you give me any advice on this idea?
>
> So, basically you are interested in the camera code
> (TracePixel::CreateCameraRay in tracepixel.cpp) which create a Ray (3D
> origin with 3D direction) from the position in the final picture.
> (unless you want to also have the reflection and refraction, at which
> point it become to be harder)
>
> Be aware that there is more than one camera's type, each with its own
> mapping.
>
> Documentation (for user, not programmer) of cameras can be seen at
> http://wiki.povray.org/content/Reference:Camera

hello,

I want to get every 3D coordinate corresponding to 2D target image.

For example, (50, 50) is a point on an 2D target image, it's on an object in a
image.
I want to get the 3D coordinate of this point, say(1, -0.8, 0.7).

Is it possible to get the 3D coordinate through altering the source code??

I asked this question before
(http://news.povray.org/povray.programming/thread/<web.51d243a492d8f63ce6ccd8f40%40news.povray.org>/),
but I found TracePixel::CreateCameraRay just get the ray not the corresponding
3D coordinate.


Thanks.^_^


Post a reply to this message

From: Le Forgeron
Subject: Re: Are there documents for the source code?
Date: 8 Sep 2014 14:26:29
Message: <540df4d5$1@news.povray.org>
On 08/09/2014 18:02, Simon wrote:

> hello,
> 
> I want to get every 3D coordinate corresponding to 2D target image.
> 
> For example, (50, 50) is a point on an 2D target image, it's on an object in a
> image.
> I want to get the 3D coordinate of this point, say(1, -0.8, 0.7).
> 
> Is it possible to get the 3D coordinate through altering the source code??
> 
> I asked this question before
>
(http://news.povray.org/povray.programming/thread/<web.51d243a492d8f63ce6ccd8f40%40news.povray.org>/),
> but I found TracePixel::CreateCameraRay just get the ray not the corresponding
> 3D coordinate.
> 
> 
> Thanks.^_^
> 

Looks at megapov, postprocessing option
> http://megapov.inetart.net/manual-1.2.1/megapov0121.html#post_processing

You want the intersection coordinates: f_output_ipoint_x(x,y),
f_output_ipoint_y(x,y), and f_output_ipoint_z(x,y).

Read carefully how to activate and use it.

(the x,y above are in 0 to 1 range, so you need to divide by the width
and height)

-- 
IQ of crossposters with FU: 100 / (number of groups)
IQ of crossposters without FU: 100 / (1 + number of groups)
IQ of multiposters: 100 / ( (number of groups) * (number of groups))


Post a reply to this message

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