realbasic-games
[Top] [All Lists]

Re: Draw algorithm slow

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Draw algorithm slow
From: Nick Lockwood <nick at charcoaldesign dot co dot uk>
Date: Tue, 29 Jun 2004 14:08:06 +0100
Delivered-to: realbasic-games at lists dot realsoftware dot com
List-help: <mailto:realbasic-games-request@lists.realsoftware.com?subject=help>
List-id: REALbasic Games <realbasic-games.lists.realsoftware.com>
List-post: <mailto:realbasic-games@lists.realsoftware.com>
References: <0DC34C9C-C9BF-11D8-8CF9-000393907B46 at pyramiddesign dot us>
I don't think most flight simulators are actually rotating a picture to draw the needle, as you're doing. Instead, they have pre-rendered needle images at all the orientations they care to draw (yes, there may well be quite a few of those). This is much faster, and often looks better too, since you can have them properly shaded and shadowed for each angle, which you can't do when simply rotating a picture.

I don't know. For example, both X-Plane and MS Flight Simulator only require that you create one needle graphic (and corresponding mask) for a gauge. Is it possible that they pre-rotate copies on startup?

I would imagine that they do the rotation using opengl and therefore the graphics hardware is doing the work.

From you description I assume that you are using these dial controls outside of the RB3D view and drawing them using the object2d rotation methods. I can tell you from experience that these methods are much too slow for real-time use. If, on the other hand you were to render your dials within your RB3D view then the real time rotation would have an utterly negligible performance hit.

If you can't do this then the only solution is to render the dials in many orientations beforehand as Joe suggested. You could however do this within the program during set up time rather than having to do it by hand in photoshop - might make life easier, as well as reducing the size of your programs resources.

Nick

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>