To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 8531
8530  |  8532
Special: 
[DAT] (requires LDraw-compatible viewer)
Subject: 
My experience with user defined colors...
Newsgroups: 
lugnet.cad
Date: 
Wed, 21 Aug 2002 19:24:54 GMT
Viewed: 
665 times
  
My experience with user defined colors in .dat files, MLCad, L3PAO, and POV.

It seems the .dat files use a pre-defined color lookup table (CLUT) for
colors 0-28 & 32-47; where 0=black, 1=blue, 2=green and so forth (LDraw
color table: http://www.ldraw.org/reference/specs/colors). I pulled these
numbers from the pre-defined CLUT in MLCad.

If you define a new color in MLCad and save a MOC as a .dat file, MLCAD adds
a comment line with the key word "COLOR". BTW the "COLOR" line in the dat
file doesn't show up in the upper "Active Model" window of MLCad (where the
parts list is), I had to view the .dat file in notepad to see the "COLOR" line.

Example (see below for full .dat file) I defined DarkRed in slot 64 as RGB =
(127, 6, 6) thus:
0 COLOR 64 DarkRed 0 127 6 6 255 127 6 6 255

BTW I couldn't find a def for "COLOR" on the LDraw site (I could have easily
missed it). But you can kinda decipefer it.

Oy! It seems that there is an issue with L3P/L3PAO and custom .dat file
colors. It turns custom colors into gray. And it seems that if there is more
then one custom color it maps all of them to gray and assigns them all the
same color#. Which makes it hard to hand edit POV file color defs. The best
bet is to use CLUT colors and redefine their value in POV by hand.

A side note the RGB values in POV range from 0 to 1, not 0 to 255.

In the POV file I changed color7 from
pigment { rgb <0.682353,0.682353,0.682353> } to
pigment { rgb <0.5,0.2,0.2> }     ...which is close to 127,6,6

The final rendering resulted in all elements assigned to color7 as dark red.

SteveB
PNLTC

============================================================================
Here is a .dat file with 4 2x4 bricks each a different color; blue, red,
custom dark red (#64), & custom violet (#65):

0 Untitled
0 Name: ColorTest1.dat
0 Author: MLCad
0 Unofficial Model
0 COLOR 64 DarkRed 0 127 6 6 255 127 6 6 255
0 COLOR 65 Violet 0 60 0 145 255 60 0 145 255
0 ROTATION CENTER 0 0 0 1 "Custom"
0 ROTATION CONFIG 0 1
1 1 0 -8 -150 1 0 0 0 1 0 0 0 1 3001.DAT
1 4 0 -8 -80 1 0 0 0 1 0 0 0 1 3001.DAT
1 64 0 -8 0 1 0 0 0 1 0 0 0 1 3001.DAT
1 65 0 -8 80 1 0 0 0 1 0 0 0 1 3001.DAT
0


============================================================================
Snips from the resulting POV file... L3P only defined 3 colors and made the
last 2 2x4 bricks the same color, color #7.

#ifndef (Color7)
#declare Color7 = #if (version >= 3.1) material { #end texture {
pigment { rgb <0.682353,0.682353,0.682353> }
finish { ambient AMB diffuse DIF }
#if (QUAL > 1)
finish { phong 0.5 phong_size 40 reflection 0.08 }
#if (BUMPS) normal { BUMPNORMAL } #end
#end
} #if (version >= 3.1) } #end
#end

#ifndef (Color1)
#declare Color1 = #if (version >= 3.1) material { #end texture {
pigment { rgb <0.0823529,0.376471,0.976471> }
finish { ambient AMB diffuse DIF }
#if (QUAL > 1)
finish { phong 0.5 phong_size 40 reflection 0.08 }
#if (BUMPS) normal { BUMPNORMAL } #end
#end
} #if (version >= 3.1) } #end
#end

#ifndef (Color4)
#declare Color4 = #if (version >= 3.1) material { #end texture {
pigment { rgb <0.968627,0.160784,0.054902> }
finish { ambient AMB diffuse DIF }
#if (QUAL > 1)
finish { phong 0.5 phong_size 40 reflection 0.08 }
#if (BUMPS) normal { BUMPNORMAL } #end
#end
} #if (version >= 3.1) } #end
#end


#declare ColorTest1_dot_dat = union {
// Untitled
// Name: ColorTest1.dat
// Author: MLCad
// Unofficial Model
// COLOR 64 DarkRed 0 127 6 6 255 127 6 6 255
// COLOR 65 Violet 0 60 0 145 255 60 0 145 255
// ROTATION CENTER 0 0 0 1 "Custom"
// ROTATION CONFIG 0 1
object {
_3001_dot_dat
matrix <1-SW/80,0,0,0,1-SW/28,0,0,0,1-SW/40,0,SW/2.8,0>
matrix <1,0,0,0,1,0,0,0,1,0,-8,-150>
#if (version >= 3.1) material #else texture #end { Color1 }
}
object {
_3001_dot_dat
matrix <1-SW/80,0,0,0,1-SW/28,0,0,0,1-SW/40,0,SW/2.8,0>
matrix <1,0,0,0,1,0,0,0,1,0,-8,-80>
#if (version >= 3.1) material #else texture #end { Color4 }
}
object {
_3001_dot_dat
matrix <1-SW/80,0,0,0,1-SW/28,0,0,0,1-SW/40,0,SW/2.8,0>
matrix <1,0,0,0,1,0,0,0,1,0,-8,0>
#if (version >= 3.1) material #else texture #end { Color7 }
}
object {
_3001_dot_dat
matrix <1-SW/80,0,0,0,1-SW/28,0,0,0,1-SW/40,0,SW/2.8,0>
matrix <1,0,0,0,1,0,0,0,1,0,-8,80>
#if (version >= 3.1) material #else texture #end { Color7 }
}



Message has 2 Replies:
  Re: My experience with user defined colors...
 
(...) If you want to use 0-255, you can do: pigment { rgb <127,6,6>/255.0 } --Bram (22 years ago, 21-Aug-02, to lugnet.cad)
  Re: My experience with user defined colors...  [DAT]
 
Steve Barile wrote... (...) (snip) (...) L3P turns all unknown colors into gray while notifying you: WARNING "ColorTest1.dat" Line 11: Unknown color, using 7: 1 64 0 -8 0 1 0 0 0 1 0 0 0 1 3001.DAT The main reason why L3P does not support the COLOR (...) (22 years ago, 21-Aug-02, to lugnet.cad)

3 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR