Hi,
I am having a 3D object.. I want to make it look very natural..
I thought applying a color gradiant would serve the purpose..
I have applied a color gradiant.. But it still doesnt look good..
Here is the code.. Can anybody please tell me what is wrong..
Thanks in advance,PHP Code:
' MAX_PRJ_LENGTH = max width of the object
' C1,C2,C3 is the Center of the Object
Zax = (Sq(1).X + Sq(2).X + Sq(3).X + Sq(4).X) \ 4
Zax = Zax - (C1 - MAX_PRJ_LENGTH \ 2)
Zax = Zax * 256 / MAX_PRJ_LENGTH
If Zax < 0 Then Zax = -Zax
Zay = (Sq(1).Y + Sq(2).Y + Sq(3).Y + Sq(4).Y) \ 4
Zay = Zay - (C2 - MAX_PRJ_LENGTH \ 2)
Zay = Zay * 256 / MAX_PRJ_LENGTH
If Zay < 0 Then Zay = -Zay
Zaz = (Zco(1) + Zco(2) + Zco(3) + Zco(4)) \ 4
Zaz = Zaz - (C3 - MAX_PRJ_LENGTH \ 2)
Zaz = Zaz * 256 / MAX_PRJ_LENGTH
If Zaz < 0 Then Zaz = -Zaz
myColor = RGB(Zax, Zay, Zaz)
Pradeep


Reply With Quote