On Sun, Aug 7, 2011 at 1:03 PM, Thorsten wrote: >> I think the problem is that you are expecting the cloud height to >> indicate the location >> of sprite centers, wherease the code is expecting it to be the height >> of the actual >> cloud. >> >> The code actually _subtracts_ the minimum texture height from the cloud >> height to determine where to place sprite centers. >> >> So, the height should always be greater than the minimum texture height. > > Oops... In hindsight, a rather obvious explanation of what I'm seeing - a > negative number created in the subtraction would of course invert the > shading pattern seen later. Rather embarrassing... > > Thanks, I'll correct my code.
Having thought about this a bit more, I'm wondering whether we should in fact change the code so that min-cloud-height-m etc. are use to determine sprite centre locations rather than the cloud edges. At present the code uses the min-cloud-height and max-cloud-height to determine the actual cloud sprite distribution as follows: float width = min_width + sg_random() * (max_width - min_width) - min_sprite_width; float height = min_height + sg_random() * (max_height - min_height) - min_sprite_height; I can see some problems with the current approach: 1) If there is a lot of variability between the min-sprite-[height|width] and max-sprite-[height|width] the cloud will go outside its bounds. So we aren't completely limiting the cloud width/height. 2) I think the z scaling parameter needs to be included in the height calculation. Possibly as a multiplier in on the "- min_sprite_height" term? What's you're view? Conceptually, having the min/max cloud width/height constrain the cloud itself seems sensible, but I wonder whether in practice is it as useful. -Stuart ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos & much more. Register early & save! http://p.sf.net/sfu/rim-blackberry-1 _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel