Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
index color value

index color value

2005-06-13       - By ozu's mailbot

 Back
Reply:     1     2  

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
 <meta content="text/html;charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1" http-equiv="Content-Type">
 <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<pre style="margin-top: 0.5em;" class="js">According to people in the know at
SOFTIMAGE, the secret formula to
encode RGB values into the wireframe color integer is the following:

wirecolor is a 10bit <tt>BBBGGGRRR0</tt> value where the first 3 bits are the
most significant (out of 8) bits of Blue <tt>BBB00000</tt>, Green <tt>GGG00000<
/tt> and Red <tt>RRR00000</tt> respectively and the last bit is left unused.

<b>Convert RGB to wire color</b>. This is done by shifting the red,
green and blue values 5 places to the right, keeping only the 3
leftmost bits and shifting right to the correct position for red green
and blue respectively.

</pre>
<div style="padding: 4px; margin-top: 0px; display: block;">
<pre style="margin-top: 0.5em;" class="js">function RGBToWire(r,g,b)
{
   var red   = ( ( r &gt;&gt; 5 ) &amp; 7 ) &lt;&lt; 1;
   var green = ( ( g &gt;&gt; 5 ) &amp; 7 ) &lt;&lt; 4;
   var blue  = ( ( b &gt;&gt; 5 ) &amp; 7 ) &lt;&lt; 7;
   return ( red | green | blue );
}

var red = 224;
var green = 96;
var blue = 0;

var wire = RGBToWire(red, green, blue);

LogMessage( "("+ red +","+ green +","+ blue +") =  "+ wire);
</pre>
</div>
<b>Convert wire color to RGB</b>. This is done by applying the inverse
transformation.<br>
<tt>function WireToRGB( wire )
{ <br>
&nbsp;&nbsp;&nbsp; var color = new Object; <br>
&nbsp;&nbsp;&nbsp; color.r = ( ( wire &gt;&gt; 1 ) &amp; 7 ) &lt;&lt; 5;<br>
&nbsp;&nbsp;&nbsp; color.g = ( ( wire &gt;&gt; 4 ) &amp; 7 ) &lt;&lt; 5;<br>
&nbsp;&nbsp;&nbsp; color.b = ( ( wire &gt;&gt; 7 ) &amp; 7 ) &lt;&lt; 5;<br>
&nbsp;&nbsp;&nbsp; return color;<br>
}
<br>
<br>
var wire = 62;<br>
var color = WireToRGB(wire);<br>
LogMessage( wire +" = ("+ color.r +","+ color.g +","+ color.b +")" );</tt>
<pre style="margin-top: 0.5em;" class="js">



</pre>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:fgiard@(protected)">fgiard
@(protected)</a> wrote:<br>
<blockquote cite="mid1118669017.42ad88da02723@(protected)"
type="cite">
 <pre wrap="">Hi everyone,
is there a quick way to convert rgg to index?  (I want to set wireframe
according to bones rgb)
thank you,
-Francois Giard

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
This message was sent using IMP, the Internet Messaging Program.

---
Unsubscribe? Mail <a class="moz-txt-link-abbreviated" href="mailto:Majordomo
@(protected)">Majordomo@(protected)</a> with the following text in body:
unsubscribe xsi
 </pre>
</blockquote>
</body>
</html>
---
Unsubscribe? Mail Majordomo@(protected) with the following text in body:
unsubscribe xsi