shading a triangle (3-vertex gradient)
i'll ask quite simple:
there triangle movie clip vertices (0, 0); b (256, 0); c (0, 256)
each vertex has color (e.g., - red, b - green, c - blue).
i need shade entire area of triangle interpolating between these 3 colors.
something gradient, has 3 vertices, not 2 linear one.
i tried 2 ways:
1) create 256x256 bitmapdata, attach clip , shade triangle in bitmap,
manually (just people programming 3d graphics before opengl&direct3d).
this works, slow (of course).
2) create 2x2 or 3x3 or other lilttle square bitmap, shade scale 256x256
with smoothing option (attachbitmap's argument) enabled. works quite fast , looks
right not quite right.
i thought on how accomplish gradient (maybe several gradients), no ideas...
you can check out code at: http://heilong.oceanography.ru/flash/lab/
there triangle movie clip vertices (0, 0); b (256, 0); c (0, 256)
each vertex has color (e.g., - red, b - green, c - blue).
i need shade entire area of triangle interpolating between these 3 colors.
something gradient, has 3 vertices, not 2 linear one.
i tried 2 ways:
1) create 256x256 bitmapdata, attach clip , shade triangle in bitmap,
manually (just people programming 3d graphics before opengl&direct3d).
this works, slow (of course).
2) create 2x2 or 3x3 or other lilttle square bitmap, shade scale 256x256
with smoothing option (attachbitmap's argument) enabled. works quite fast , looks
right not quite right.
i thought on how accomplish gradient (maybe several gradients), no ideas...
you can check out code at: http://heilong.oceanography.ru/flash/lab/
why keep posting same thing? there isn't question in there. have question?
most people here looking basic stuff , not gouraud shading. @ general theory level.
seems you've got sown up. 1) not fast 2) faster not quite right.
flash isn't complex rendering , bitmaps. sure they've added bitmap class , nice things difficult (and not possible) before. still quite tied past platform delivering small files on internet.
most people here looking basic stuff , not gouraud shading. @ general theory level.
seems you've got sown up. 1) not fast 2) faster not quite right.
flash isn't complex rendering , bitmaps. sure they've added bitmap class , nice things difficult (and not possible) before. still quite tied past platform delivering small files on internet.
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment