Click to See Complete Forum and Search --> : Is there anyway I can gradient a LINE???


AndyK
September 23rd, 1999, 06:09 PM
Like from black to blue.....or you can change colors(as RGB)

THANK YOU

Ravi Kiran
September 23rd, 1999, 11:55 PM
Use PSet and display each point!. Probably its performance would be bad, if you are looking for graphics effects

i = 0: x = 0
do
y = m1*x + c1 ' standard stline formula.
' Modify m1 & c1 to get the effect
' m1 = (y2-y1)/(x2-x1), for a line passing thru
' 2 pts (x1,y1) to (x2,y2)
'
' or use the 2pt formula:
' (y-y1)(x2-x1) = (y2-y1)(x-x1) and rearrange
' and tune for performance.

' if you want a parametric representation of st line
' x = (x2-x1)*t + x1
' y = (y2-y1)*t + y1 ' will draw the line from
' (x1,y1) to (x2,y2), where t is the param goes from 0 to 1
' so set t = i * 1/255 and it will increment
' exactly as the color index. provided you have 255 color support for each color

pset (x,y), RGB(i,0,0) ' Red line
pset (x,y), RGB(0,0,i) ' Blue line
i = i + 1
x = x + 1
loop while i <= 255




RK