POV-Ray : Newsgroups : povray.binaries.scene-files : Making #includes self-renderable - e.g. reference_axis.inc Server Time
1 Sep 2024 14:28:39 EDT (-0400)
  Making #includes self-renderable - e.g. reference_axis.inc (Message 1 to 3 of 3)  
From: Charles C
Subject: Making #includes self-renderable - e.g. reference_axis.inc
Date: 30 Nov 2006 02:45:01
Message: <web.456e8add72f3c5b3ee21010a0@news.povray.org>
This is related to the POV-Ray Includes discussions going on in several
threads...  Here's a small example of one option/feature I'd like to
promote here ;-) Self-renderable #includes. I think this practice gives a
little instant-gratification for the casual #include-file browser.  It
wouldn't be appropriete for all #include files but hey... for demo-ing
objects it's a convienience.

Charles


Post a reply to this message


Attachments:
Download 'reference_axis.inc.txt' (5 KB)

From: Charles C
Subject: Re: Making #includes self-renderable - e.g. reference_axis.inc
Date: 30 Nov 2006 03:10:00
Message: <web.456e90a26e4b5628ee21010a0@news.povray.org>
Err, I just noticed I had unnecessary #declares in there, so here it is
fixed.


Post a reply to this message


Attachments:
Download 'reference_axis.inc.txt' (4 KB)

From: nemesis
Subject: Re: Making #includes self-renderable - e.g. reference_axis.inc
Date: 30 Nov 2006 04:40:00
Message: <web.456ea5fa6e4b56283976a8750@news.povray.org>
yes, good usage for the proposed Main_POV_File variable. :)

but if we're getting such code in all include files -- rather than letting a
server-side script render sample scenes for the includes -- we could still
go one better by having a quick_setup macro of sorts and call that for the
subject object, instead of relying on bug-prone manual copying-pasting or
per-include setups.

Like, instead of:

#if (strcmp(Main_POV_File, "reference_axis.inc") = 0 )
//background {rgb 1}
camera { location  <5,5,5> look_at <0,0,0> direction <0,0,2> sky y up y
right x*image_width/image_height   } //POV standard L/H
//camera { location  <5,5,5> look_at <0,0,0> direction <0,0,2> sky z up z
right x*image_width/image_height   } //Z up, CAD R/H
light_source {<500,500,500> color rgb 1}
object{Reference_Axis}
#end

you'd get something like:

#if (strcmp(Main_POV_File, "reference_axis.inc") = 0 )
  #include "stdsetups.inc"; quick_setup( Reference_Axis )
#end

which would render a standard demo scene setup for said object.  It could
take the object's bounding box information for correctly setting relative
camera and lighting positioning.

ah!  the beauty of abstracting details away... :)


Post a reply to this message

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