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 / 11937
11936  |  11938
Subject: 
Re: New colours in Ldraw?
Newsgroups: 
lugnet.cad
Date: 
Thu, 7 Oct 2004 19:28:41 GMT
Viewed: 
1551 times
  
In lugnet.cad, Travis Cobbs wrote:
So, just so that I understand, are you saying that ldraw subtracts 64 from
colors between 64 and 128, and uses that new value as the color?  I wasn't
aware of this behavior.  (I understand it might not do exactly that; I just
want to know if that is the effective result.)

Yes, basically.  LDraw color codes are bit-mapped.

Bit 8 -> 0=normal, 1=dithered
Bit 5 -> 0=opaque, 1=transparent (when bit 8 is 0)
Bit 0-3 -> Color index (when bit 8 is 0)

When LDraw goes to draw an opaque color, it does (color && 0xF) to mask off the
higher bits.

The effect of this is that color codes 0 to 255 all map to one of the 16 core
colors (except for codes 16 and 24, which are handled specially).  Codes repeat
in blocks of 16.  Half of the codes are opaque, and half are transparent.

For example, LDraw treats codes 1, 17, 65, 81, 129, 145, 193, and 209 as blue.
Codes 33, 49, 97, 113, 161, 177, 225, and 241 are trans-blue.

Unfortunately, the extended color codes we've assigned (from 17 to 30) weren't
picked with this behavior in mind, so they don't degrade gracefully in LDraw.

Steve



Message is in Reply To:
  Re: New colours in Ldraw?
 
(...) So, just so that I understand, are you saying that ldraw subtracts 64 from colors between 64 and 128, and uses that new value as the color? I wasn't aware of this behavior. (I understand it might not do exactly that; I just want to know if (...) (20 years ago, 7-Oct-04, to lugnet.cad)

20 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