Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hey, Im not a new prog.er, but not really a newbie, anyone w
#1
:bounce: OK...I'm pretty good progger, and I do graphixNot the best, but in the group i program in, there are very good. I've self taught myself, and need some help using PALETTE.
How do I use it effectively in 3d artwork?
If I were to make a total red scale, how would i accomplish it?
`->Or for that matter, and colour.
would it be affective if I were to make a Z axis as the shade of colour?

<brain drain> :o
ok, Im good.

Can someone help me?

Tongue Alex Tongue :lol:
Reply
#2
Quote:How do I use it effectively in 3d artwork?
well, you wouldnt, it would work better in an rgb mode. but i'd use a 332 palette for that (will explain if you need me too).

Quote:If I were to make a total red scale, how would i accomplish it?
remember there's a red attribute, green attribute and blue attribute.

so you'd want find the average of the three, and set the average to the red attribute while leaving the others blank. use this code:

Code:
for x = 0 to 255 'loop each color
   out &h3c7, x  'tell vga register to read a color attribute
   r = inp(&h3c9) 'takes in r, g, b values from register
   g = inp(&h3c9)
   b = inp(&h3c9)
   average = (r + b + g) \ 3   ' finds the average of the three
   if average > 31 then         ' if it's brighter than pure red...
     average = average - 31 'find out how much brighter
     out &h3c8, x                 'tell vga register to write a color attribute
     out &h3c9, 63               'make red 63
     out &h3c9, (average / 32) * 63  'set green and blue
     out &h3c9, (average / 32) * 63
   else                       'otherwise
     out &h3c8, x        'tell register to write a color attribute
     out &h3c9, (average / 31) * 63   'make red the percentage.
     out &h3c9, 0      'make the rest zero, since they are not there.
     out &h3c9, 0
   end if
next x

Quote:would it be affective if I were to make a Z axis as the shade of colour?
ya' lost me there...
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#3
"Would it be effective if i use a Z axis as colour?"
`->not exactly what I said, but what i mean is:

you know that blood red and rosey red are both red, rite?

IF Z = 0 then red.shade = light red
IF Z = 255 then red.shade = deep red

Not exactley QBASIC, but i hope you get my point

:wink: Alex :lol:
Reply
#4
So you want to change from how close and how far the object is to how dark the colour is?

Well, id reccomend (rel will hate me for this) colour look up tables, itll take 64kb ram, and you can use it with something like makecol(r,g,b,), i think cosmo x would supply a routine like this since it uses lookup tables,

or you could instead do,(faster and simpler) create 16 red colours, lets say colours 100 - 115. Make it a gradient eg, 100 bright red, 115 dark red. now calculate if its really close using your own method and choose which colour you think is best...

if you are texturing everthing, it might be a bit of a pain though, and slow.


IF only one object is using said colour however, you could simply change its settings like toonski showed, and have it brighter or darker dependingon how far it is. But remember, that colour will affect all objects using it.

Erm, i think im rambling, hope something i said helped a bit.... or maybe i misread you compeltely.
b]Hard Rock[/b]
[The Stars Dev Company] [Metal Qb flopped] [The Terror]
Stop Double Posts!
Whats better? HTML or Variables?
Reply
#5
well, depending on your palette you can set a gradient range for red. for instance, if you (like that wretched virtual boy) were to set up a red gradient palette:

Code:
d! = 63 / 127
for i = 0 to 127
  out &h3c8, i
  out &h3c9, d! * i
  out &h3c9, 0
  out &h3c9, 0
next i

for i = 128 to 255
  out &h3c8, i
  out &h3c9, 63
  out &h3c9, d! * (i - 128)
  out &h3c9, d! * (i - 128)
next i

you could say something like that, yeah

Code:
sx = x / z + 160
sy = y / z + 100
pset (sx, sy), 255 - z

such that the closest z would be white and the farthest z would be black, and the middle z would be red.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)