Page 2 of 3

Posted: Fri Oct 08, 2004 10:29 pm
by Guest
Okay.... what better way is there?

Posted: Fri Oct 08, 2004 10:33 pm
by Don Pwnious
Thats the part i have to figure out

Re: Triangle Fractal

Posted: Fri Oct 08, 2004 10:35 pm
by Falco Girgis
Arce wrote:If anyone of you ever checked out my development topic, you'd know that I would like some guidence on this. As I'm sure we all know, there is a random fractal with a triangle, and inside is a triangle, dividing it into three triangles, and a triangle in those three dividing each into three, and so on. I would like to make a program that does that in blitz. I have no clue where to strat. Guidence would be nice, IF anyone had the time over all the NEStix stuff.
That's the most undescriptive, terrible description you could of written. I think I may of even figured out how to do it. Then I reread your post, and now I don't what in the HELL you want to do. Draw a picture or something.

Posted: Sat Oct 09, 2004 8:26 am
by Don Pwnious
wait how is fractional triangles fun??

Posted: Sat Oct 09, 2004 8:35 am
by Falco Girgis
Okay, from what I saw (he drew me a little picture so you guys would have no clue). First off, you need to know how to draw pixels. Once you can do that, you need to make a function that is able to graph a line using the pixels. The formula you'd use is:

Code: Select all

y2 - y1          rise
--------    =   ------
x2 - x1          run
You'd be basically graphing slope there, dammit, I'll think of more later. I had an idea, but it won't be easy. The line drawing thing is essential though. So like, yeah.

Posted: Sat Oct 09, 2004 8:44 am
by Don Pwnious
yes of course

Code: Select all

Global y1 = 0
global y2 = 0

global x1 = 0
global x2 = o
(except replace 0 with something else)
then make the slope formula a function.
then draw image

Posted: Sat Oct 09, 2004 11:36 pm
by MarauderIIC
You draw 3 lines, take the midpoints of each, draw 3 lines btwn those. But then the tricky parts: Know to get the midpoints in top section, bottom right section, bottom left section. Inside the 2nd is easy. But you just have to know how to select which ones you need. I think you'd make, after the 1st, 4 new triangles class copies (one for top sec, one br sec, one bl sec, one mid sec).

Posted: Sun Oct 10, 2004 12:47 am
by Guest
Before I gave up, I tried several things not at all unlike the just mentioned.

Posted: Sun Oct 10, 2004 11:43 am
by Don Pwnious
So im guessing someone should lock this topic since it wont be any use to anyone.

Posted: Sun Oct 10, 2004 12:35 pm
by Falco Girgis
Arce, you'll never be a good programmer. Programming is about pushing yourself to the limits, it's about doing stuff that you believed yourself not capable of, it's about PWNing the thing that needs to be done, it's about sticking it to the man!

If I gave up on all of the stuff that I couldn't get, we wouldn't be here now. There would be no TheChaosrift.com, I wouldn't be working on NEStix. Nope. Programming is not supposed to be easy.

When you get knocked on your ass, you get back up and ram your foot right back up its ass!

Posted: Sun Oct 10, 2004 3:04 pm
by Don Pwnious
What HE QUITED THE TRIANGLE THING?????

Posted: Mon Oct 11, 2004 7:18 pm
by JS Lemming
No offense, but you guys are clueless. First off, you don't make fractals with objects like triangles, that is what the actuall fractal is for. You make the fractal out of points or pixels. Compile the code foo.

Code: Select all

;Set graphics mode
Graphics 1024,768

;Seed the random generator
SeedRnd(MilliSecs())

;Set buffer to backbuffer
SetBuffer BackBuffer()

Global manx# = 0.0
Global many# = 0.0

Global n#

Global timer = 0

Cls

Color 150,150,150
Text 0,600,"Generating Fractal"
Text 0,612,"Press Space to cancel"
Text 0,624,"Press Esc to exit"

Flip

For i = 0 To 430000
	
	n = Rnd(0,1)
		
	If n <= (0.333333)
	
		Color Rand(100,255),0,0
		;Color 255,0,0
		;Color Rand(0,255),Rand(0,255),Rand(0,255)
	
		manx = manx * .5
		many = many * .5

	ElseIf n > (0.333333) And n <= (0.666666)
	
		Color 0,Rand(100,255),0
		;Color 0,255,0
		;Color Rand(0,255),Rand(0,255),Rand(0,255)
	
		manx = .5 * (.5 + manx)
		many = .5 * (1 + many)
	
	ElseIf n > (0.666666)
	
		Color 0,0,Rand(100,255)	
		;Color 0,0,255
		;Color Rand(0,255),Rand(0,255),Rand(0,255)
	
		manx = .5 * (1 + manx)
		many = .5 * many
		
	EndIf

	If timer < 0
		Flip
		timer = 1500
	Else
		timer = timer - 1
	EndIf
		
	If KeyDown(57) Then Exit

	pix(manx,many)
	
Next


Flip

While Not KeyDown(1)

	;just sit back and take a gander

Wend

End


Function pix(x#,y#)

	Plot(x*GraphicsWidth(),y*GraphicsHeight())
	;Oval x*GraphicsWidth(),y*GraphicsHeight(),4,4,1

End Function
Yeah I made that baby a long time ago... I don't know about you guys but fractals make me feel all warm and fractally inside.

PS: I have some things noted out. try switching them out for different effects. I have it set to somewhat random color but within bounds currently, it gives it a nice shimmer effect.

OH! And just in case you don't have blitz or too lazy to compile, here is a screenie.

Image

Posted: Mon Oct 11, 2004 8:54 pm
by Falco Girgis
JS Lemming wrote:No offense, but you guys are clueless. First off, you don't make fractals with objects like triangles, that is what the actuall fractal is for. You make the fractal out of points or pixels.
I disagree. Yes, clueless I was sorta. But you VERY well coulda made something semi-similar out of lines as well. A fractal is not a preset thing. A fractal is chaos. Almost undefinable. You can't set rules for how fractals are made, nor can you make rules for one fractal and use it for another.
dictionary.com wrote: Fractals:
A geometric pattern that is repeated at ever smaller scales to produce irregular shapes and surfaces that cannot be represented by classical geometry. Fractals are used especially in computer modeling of irregular patterns and structures in nature.
There is no predetermined way to make a fractal.

Posted: Mon Oct 11, 2004 8:56 pm
by Falco Girgis
Oh, hey, did you just add that picture?
That's awesome.
:bow: :worship:

Posted: Mon Oct 11, 2004 8:57 pm
by JS Lemming
True, but come on! Pixels are better then lines!