Search found 1307 matches

by dafhi
Feb 07, 2012 1:09
Forum: Tips and Tricks
Topic: terminal velocity
Replies: 5
Views: 1043

Re: terminal velocity sim

Interesting that k seems to represent the density of the surrounding medium, and that you've used e.
It gives a satisfying result.

I hope to be working with sequence sums again soon because I love exploring this stuff
by dafhi
Feb 06, 2012 8:01
Forum: Community Discussion
Topic: Bryce 7 Pro
Replies: 2
Views: 435

Bryce 7 Pro

is up for grabs "for a limited time". I've used Bryce before, and Pro has some cool features like indirect illumination.

Enjoy :)
by dafhi
Feb 02, 2012 5:31
Forum: Tips and Tricks
Topic: Sort Array
Replies: 62
Views: 11864

Re: Sort Array

My sort is about 6% faster than this crt qsort, but only up to about 70k elements. Dim As Integer NumElements = 65000 Dim Shared As double mTimeQ,mTimeG,MinLoopTime Dim Shared As String strNum,strDen #include "crt.bi" function compare naked cdecl( byval elem1 as any ptr, _ byval elem2 as a...
by dafhi
Jan 31, 2012 1:46
Forum: General
Topic: Bug in lbound and ubound within sub?
Replies: 4
Views: 318

Re: Bug in lbound and ubound within sub?

Code: Select all

sub test(ary() as integer)
    print lbound(ary,1),ubound(ary(423545),1)
end sub

dim as integer a(1 to 5)
test(a())
? LBound(a(23455242),1)
Sleep
by dafhi
Jan 31, 2012 1:19
Forum: Tips and Tricks
Topic: accurate alpha blend
Replies: 4
Views: 817

Re: accurate alpha blend

hi Dr_D Thanks for sharing your core blend function. Your original uses (255 * delta) Shr 8 which of course is not accurate, but meant for speed. #Include "fbgfx.bi" #Define TRUE -1 #Define FALSE 0 ScreenRes 400, 400, 32,, fb.GFX_ALPHA_PRIMITIVES Const MagicNumber = 256 * 255 + 128 Sub Sho...
by dafhi
Jan 30, 2012 23:49
Forum: Tips and Tricks
Topic: accurate alpha blend
Replies: 4
Views: 817

Re: accurate alpha blend

Hi Gonzo, The sub you have provided is good. The short answer to your question is "no" because you are still using a ruler that is the same size (256 - 1) while trying to divide it by a bigger ruler. Sub AlphaBlend32(ByRef dest As UInteger, ByVal src As UInteger, ByVal opacity as UByte) ' ...
by dafhi
Jan 30, 2012 21:04
Forum: Tips and Tricks
Topic: Dynamic arrays in UDTs (once again)
Replies: 15
Views: 4062

Re: Dynamic arrays in UDTs (once again)

Very nice.
by dafhi
Jan 30, 2012 3:38
Forum: Tips and Tricks
Topic: accurate alpha blend
Replies: 4
Views: 817

accurate alpha blend

' ---------------------------------- ' ' accurate alpha blend demo ' ' by cRex ' ' ---------------------------------- ' ' - Overview - 'Many internal alpha blending functions sacrifice quality for speed. 'Blending artifacts emerge because r,g,b get multiplied by an alpha 'ranging from 0 to 255, and...
by dafhi
Jan 29, 2012 2:43
Forum: Tips and Tricks
Topic: terminal velocity
Replies: 5
Views: 1043

terminal velocity

[2017 Sep 17] - accurate, framerate-independent #ifndef pi const TwoPi = 8*atn(1) const Pi = 4*atn(1) #EndIf type float as single type v3 as float x,y,z declare function rndf as v3 declare sub rand End Type sub v3.rand y=2*(rnd-.5): var r=sqr(1-y*y) z=rnd*twopi: x=r*cos(z): z=r*sin(z) End Sub functi...
by dafhi
Jan 17, 2012 10:26
Forum: Tips and Tricks
Topic: mandelbrot
Replies: 14
Views: 1928

Re: mandelbrot

Thanks for your input! It has been updated :)
by dafhi
Jan 16, 2012 5:04
Forum: Tips and Tricks
Topic: mandelbrot
Replies: 14
Views: 1928

Re: mandelbrot

Nice update
by dafhi
Dec 16, 2011 6:28
Forum: General
Topic: Squares
Replies: 7620
Views: 455792

looks great dodi
by dafhi
Dec 06, 2011 20:51
Forum: Tips and Tricks
Topic: 3D surface plot
Replies: 22
Views: 3156

I sometimes see something that needs fixing right after I post. Anyway, here. Neat project. #Macro zInsertionSort() i = 1 For j = 2 To lEnd If zeds(i) > zeds(j) Then sng_swap = zeds(j) uint_swap = cols(j) vect_swap = e(j) k = i zeds(j) = zeds&#...
by dafhi
Nov 26, 2011 4:24
Forum: General
Topic: Squares
Replies: 7620
Views: 455792

albert that looks amazing
by dafhi
Nov 23, 2011 13:30
Forum: Tips and Tricks
Topic: Simple lightning bolt algo
Replies: 18
Views: 2472

@dodicat

There's a sense of impressionism to that. The air crackles, and the humidity is present. It's also up close and personal. You paint the atmosphere well. I live in a desert section of the pacific northwest (usa) where avg humidity is 43%

Go to advanced search