c++ - Math Behind Flash Vector Graphics? -
i've been searching vector graphics , flash quite time haven't found looking for. can tell me area of mathematics required building vector images in 3d space? vector math? saw c++ libraries wasn't sure if sort of vectors meant smaller file size flash images are. in advance.
if you're wanting scratch (there plenty of open-source libraries out there if don't), maintain in mind "vector graphics" (this different thought of 3d space vector) typically based on parametric curves bezier curves, 3rd grade polynomials each x, y, and/or z point parameterized value t goes 0 1. projecting texture-map image create curves (i.e., so-called "vector graphics" image) onto triangle polygon via uv coordinates involve interpolation, straight forwards linear algebra, utilize barycentric coordinate of 3d point on surface of triangle polygon in order calculate uv point want look-up texture.
so steps are:
create parametric-curve based image (i.e, "vector graphic") , create texture map out of it that texture map have uv coordinates when rasterize 3d triangle polygon, barycentric coordinate on surface of triangle actual 3d points of triangle polygon. points of polygon should have uv coordinates assigned them. use barycentric coordinates calculate uv coordinate on texture map. when color texture map, shade triangle (i.e, calculate lighting, etc. if that's you're doing, or save color of pixel if there no lighting).please note haven't gotten antialiasing, that's different beast. best thing if don't know you're doing there brute-force antialias through super-sampling (i.e., render big image , average pixels shrink desired size).
if you've taken multivariable calculus, concepts behind parametric curves , surfaces should familiar, , basic understanding of linear algebra necessary in order work barycentric coordinates , linear interpolation 3d vectors.
c++ flash math vector graphics
No comments:
Post a Comment