realbasic-games
[Top] [All Lists]

Re: Vertex Colors

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Vertex Colors
From: Frank Condello <developer at chaoticbox dot com>
Date: Tue, 13 Dec 2005 17:12:20 -0500
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <328800874cbf85936b626c9b2d927a39 at pyramiddesign dot us> <a0620070abfc4ba334e7e at [10 dot 0 dot 1 dot 4]> <b7863075141cbd28afc3ae4791b95116 at pyramiddesign dot us> <a06200714bfc4dd3782d0 at [10 dot 0 dot 1 dot 4]> <3dd65603df103e3ba5ccbadc6660d259 at pyramiddesign dot us> <a06200717bfc4e91149f6 at [10 dot 0 dot 1 dot 4]>
On 13-Dec-05, at 4:10 PM, Joseph J. Strout wrote:

At 3:36 PM -0500 12/13/05, Joseph Nastasi wrote:

AHA! So, I can use:
tm.VertexColors.Item(0) = &cCC0000
tm.VertexColors.Item(1) = &cCC0000
tm.VertexColors.Item(2) = &cCC0000

to set the trimesh (it's just a simple triangle.) color to a not- so-bright red. Then use:

tm.VertexColors.AddRGBToAll -10, 0, 0

in a loop to gradually turn the color black, right?

Although the bulk per-vertex transformations are handled relatively quickly in C++ code, Material.DiffuseColor would be much more efficient for this situation (i.e. a solid coloured mesh changing to some other solid colour). You may not see a difference for one or two triangles, but even a modestly dense mesh will slow you down if you're changing vertex colours every frame to do a fade like you're describing.

Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––

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

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


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