Re: Newbie looking for info on basic graphics with Delphi.



On Mon, 30 Oct 2006 10:03:34 +0100, "Maarten Wiltink"
<maarten@xxxxxxxxxxxxxxxxxx> wrote:

[..]
But Delphi also offers the TPaintBox, which takes a different approach.
The pixels are redrawn every time Windows needs them, by the programmer
hooking the OnPaint event. If rendering the image is not much work,
this is more lightweight than the bitmap's caching. In my opinion and
experience, drawing a wireframe isn't much work and so my OnPaint handler
was a simple 'Canvas.Assign(Model)'. (The Model has an overridden
AssignTo which knows that assigning to a TCanvas means to draw itself
onto it.)

It might be argued that recomputing the complete cordinate transforms
every time was a bit over the top. But the usual cause for an Invalidate
_was_ that the coordinate transform had changed (user input to the
viewer: rotating/translating/zooming) and at least I didn't repeat it
for every individual line.


Where can I find some basic algorithms for wireframe drawing?

I have some source. I'll see if I can put it on my website.

Would it be asking too much of you to post an example of what you
describe here? Please and thanks!

.