Special:
|
[DAT] (requires LDraw-compatible viewer)
|
Subject:
|
Re: POV Color Cheat! Turn Pink into Medium Blue
|
Newsgroups:
|
lugnet.cad.ray
|
Date:
|
Mon, 9 Apr 2007 23:01:49 GMT
|
Viewed:
|
7063 times
|
| |
| |
In lugnet.cad.ray, Jeroen de Haan wrote:
> In lugnet.cad.ray, Dave Schuler writes:
> > Would it be possible to inline certain hard-to-achieve POV-Ray colors in a
> > primitive file so that the color would be available in rendered models without
> > having to tweak the output file? Something like this:
> >
> > 0 stud.dat primitive
> > 0 L3P IFNOTPOV
> > 1 16 0 0 0 6 0 0 0 1 0 0 0 6 4-4EDGE.DAT
> > 1 16 0 0 0 6 0 0 0 -4 0 0 0 6 4-4CYLI.DAT
> > 1 16 0 -4 0 6 0 0 0 1 0 0 0 6 4-4DISC.DAT
> > 1 16 0 -4 0 6 0 0 0 1 0 0 0 6 4-4EDGE.DAT
> > 0 L3P ELSEPOV
> > 0 #declare color384 =
> > 0 { whatever RGB values you like}
> > 0 { as well as any textures, etc...}
>
> [ snipped ]
>
> Intresting, and yes it will work but with a few buts.
> First you will need to do the color-declaring before you do your model. And
> you have to (well, not "have to" but is saver to) "undeclare" (or undef) the
> old color definition.
> This syntax works:
>
> 0 L3P IFPOV
> 0 #undef Color384 // just to be sure
> 0 #ifndef (Color384)
> 0 #declare Color384 = #if (version >= 3.1) material { #end texture {
> 0 pigment { rgb <0.8,0.5,0.15> }
> 0 finish { ambient 0.45 diffuse 0.85 }
> 0 finish { phong 0.5 phong_size 40 reflection 0.5 }
> 0 #if (BUMPS) normal { BUMPNORMAL } #end
> 0 #end
> 0 } #if (version >= 3.1) } #end
> 0 L3P ENDPOV
> 1 10 0 0 0 1 0 0 0 1 0 0 0 1 4198.DAT
> 1 384 140 0 140 0 0 1 0 1 0 -1 0 0 4198.DAT
> 0
>
> Again, I used #undef to clear the old definition (line 2) and line 3 checks
> if there already is a definition for Color384.
> Line 3 to 10 is copied from the normal L3P/POV color-definition. You can add
> or change parameters if you want. After the ENDPOV the LDraw model starts.
> Good idea Dave!!!
This is a great idea that deserves to be highlighted while we're waiting for L3P
and other programs to support ldconfig.ldr!
Inpired be the objects like timers, dialog objects, menu items etc I add to a
Form in a Delphi project, I just came up with the idea of adding dat objects
with color redefinitions in a similar way into a ldr model. This way, I get away
from the postprocessing of Pov files that I really love to avoid.
Here's an example of how to turn all Color13 (pink) parts into Color73 (medium
blue):
------------------
0 Color 73 Test
0 Name: Color73.ldr
0 Author: Tore Eriksson
1 16 0 0 0 1 0 0 0 1 0 0 0 1 C13-73.dat
1 1 0 0 0 1 0 0 0 1 0 0 0 1 3001.dat
1 13 0 -24 0 1 0 0 0 1 0 0 0 1 3001.dat
0
------------------
0 POV-Ray Redefine Color 13 (pink) into Color 73 (medium blue)
0 Name: C13-73.dat
0 Author: Tore Eriksson
0 REM Idea ripped from Jeroen de Haan and Dave Schuler
0 REM http://news.lugnet.com/cad/ray/?n=1378
2 24 0 -2 0 0 2 0
0 L3P IFPOV
0 #undef Color13 // just to be sure
0 #ifndef (Color13)
0 #declare Color13 = #if (version >= 3.1) material { #end texture {
0 pigment { rgb <0.43,0.6,0.785> }
0 pigment { rgb <0.43,0.6,0.785> }
0 finish { ambient AMB diffuse DIF }
0 #if (QUAL > 1)
0 finish { phong 0.5 phong_size 40 reflection 0.08 }
0 #if (BUMPS) normal { BUMPNORMAL } #end
0 #end
0 } #if (version >= 3.1) } #end
0 #end
0 L3P ENDPOV
0
------------------
Just run the sample file Color73.ldr through L3P and without any extra hassle
you have medium blue defined in Color13 (former pink). Just watch out so you
don't have any parts or pattern details you want pink, or they'll go medium
blue, too. :)
Of, course, you can redifine any color by editing and renaming C13-73.dat at
will. Or you can make a better light green. Or add attributes that turns a
certain "color" into metal or wood or...
Just note that the LDraw viewer programs will not change the colors, only the
POV-Ray output.
/Tore
|
|
Message has 1 Reply: | | Re: POV Color Cheat! Turn Pink into Medium Blue
|
| (...) If you want to see the medium blue in LDView, just add the following line to C13-73.dat (anywhere outside the IFPOV section): 0 !COLOUR Medium_Blue CODE 13 VALUE #6E99C8 EDGE 0 Tore, is the color 24 line in the file necessary in order to make (...) (18 years ago, 9-Apr-07, to lugnet.cad.ray)
|
Message is in Reply To:
| | Re: POV Color Cheat? [DAT]
|
| (...) [ snipped ] Intresting, and yes it will work but with a few buts. First you will need to do the color-declaring before you do your model. And you have to (well, not "have to" but is saver to) "undeclare" (or undef) the old color definition. (...) (22 years ago, 5-Aug-02, to lugnet.cad.ray)
|
11 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|