没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > v4p |
v4p
|
0 | 0 | 74 |
贡献者 | 讨论 | 代码提交 |
IntroductionV4P - Vectors For Pocket - is a minimalistic layered polygons scan-conversion engine. See http://en.wikipedia.org/wiki/Scanline_rendering if you don't understand what it deals with.
V4P consists in a ridiculously short piece of C code. V4P main engine weights ~1000 instructions.
V4P targets very light platforms without advanced graphic processing hardware resources.
V4P may be easily embedded in any GUI or Game development library or application.
V4P has no dependencies with any other library. V4P even brings its own integer only maths routines.
V4P only asks you to provide an horizontal line drawing function (a memset()-like function should work well in most cases).
Beside rendering vectors scene, V4P will help you find collides.
Design IntroductionThe underlying algorithm of V4P can be named:
"Bresenham-like iterative scan-line and active edge cross-over computation based polygon scan conversion algorithm".
Additionally, most V4P computed lists are smartly quick-sorted, while bit-based computation helps V4P to find collides and pixel highest owner.
V4P design spares memory a lot. It doesn't deal with Z-buffer, not even "S-buffer" (as depicted here: http://www.gamedev.net/reference/articles/article668.asp).
V4P has been developed and tested on a very old Sony Clie PDA with Palm OS 4 gcc based SDK. V4P should be able to be adapted with few tweakings on any embedded Linux devices and other geeky gadgets.
Further experiments / What to do next?Actually, V4P is not a drawing engine. No span drawing function are provided. Except from the PDA experiment I've done. So...
writing more span drawing functions# writing a Linux frame buffer port
- write a SDL port
- write a DirectFB port
- write a DS Linux port
Keep in mind the Color type is a pointer which may actually lead to a structure giving much more information about the way to fill up a polygon, eg. a pixmap.
- simple anti-aliasing solution through rescaling trick
writing other libraries on top of V4P# use V4P to design a Flash-like technology
- use V4P as a basis for a full animated GUI stack
adding featurestransparent polygonsthis feature needs a change in the pixel parent election code so to call the span drawing routine from the highest opaque polygon to the highest translucent polygon up there.
adding other edge shapesI miss circular curves a lot. But I didn't find a way to draw them in a single pass algorithm. A simple Bezier discretisation algorithm may help. But has it to be in the core library?
increasing z depth rangeonly 16 layers for now. Using a balanced binary tree of span parents could make z infinitively more precise.
Use more accurate cos/sin/atan/dist routinesavoid refreshing the static parts of the scenean integrated solution need an in-depth rewrite an other solution may be to call the V4P engine repeatedly on "dirty rectangles". A top library could do that.