Jump to content



Photo
- - - - -

Project: Kaos Generator


  • Please log in to reply
25 replies to this topic

#1 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 18 September 2005 - 06:49 PM

Hi everyone! :)

I am actually working on a fractal explorer which can display the Mandelbrot fractal with 9 variants, the Julia fractal and the Henon Attractor. Unfortunately, I can't solve the zoom problem, and I would like someone to help me, please !!! :( I worked on it all the holyday, and I didn't foind the solution yet.

Here is the source code

And here are some screenshots :

Posted Image Posted Image

And if you know the Lyapunov's and Newton's fractals, and Clifford A.Pickover and Gumowski-Mira attractors, please tell it to me. :greengrin:

Good bye, and spend a great time in these beautiful fractals. ;)

#2 PAP

PAP

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 681 posts
  • Gender:Male
  • Location:Somewhere in Europe.
  • Interests:Computer Algebra, Numerical Analysis.

  • Calculators:
    ClassPad 300 (plus an old Casio model, with only a few Kb ram).

Posted 18 September 2005 - 10:08 PM

Nice work, but ClassPad's screen is black & white. Need I to say anything else?

#3 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 19 September 2005 - 03:37 AM

Nice add-in. B)

So exactly which zoom problems are you talking about? I did notice the scan lines that don't always draw. It looks like its a truncation problem when converting from float to SIGNED. Try this...
SIGNED FractalWindow::toPxlX(float x)
{
	return (x - xmin) / dot + 0.5;
}

SIGNED FractalWindow::toPxlY(float y)
{
	return mReal.wBottom - ((y - ymin) / dot +0.5);
}


#4 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 19 September 2005 - 09:28 AM

Yes, I noticed these white lines, but it isn't the real problem. Sorry, I modified the source code to try to solve the zoom problem, so it's normal that the compiler detects some errors. And I modified the zoom, so you can get a fatal error on your ClassPad. Normally, when you click somewhere on the fractal, it must zoom on the part you clicked. But it never zooms correctly, it is always shifted. I'm posting at school, but normally, we are'nt allowed to go on forums. I will rewrite the zoom function.
Note:I managed to solve the Lambda fractal and its variants' problem.

Are my English translations correct ? If no, please tell me the mistakes I did in the menus.
And if there are Spanish, German or Portuguese people here, it would be great that they make a translation in their native language. ;)

Bye!

#5 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 19 September 2005 - 03:57 PM

Are my English translations correct ? If no, please tell me the mistakes I did in the menus.
And if there are Spanish, German or Portuguese people here, it would be great that they make a translation in their native language. ;)

Your English is good. I am glad that you are using the multi-language feature. ;) Let me know if you have a difficult problem solving a bug and maybe I can help.

Also, I noticed you can do a few things to improve the speed...

1) You call Invalidate for the entire window. This will update the entire display. If you use a PegRect you can update only that rectangle.

2) You update the statusbar in an inner loop. You should move the "update status bar" to just above the EndDraw.

3) It looks like you are doing a full screen scan most of the time (i.e. for(y=ymin;y<=ymax;y+=dot) .. for (x=xmin,x<=xmax; x+= dox) ). This means you are drawing or clearing every pixel. You are drawing in world coordinates (floats). Since you are visiting every pixel you can draw in screen coordinate (SIGNEDs) which will be faster.

If you want I can give you an example in your code.

Thanks for all the work on the nice add-in. B)

#6 betoe

betoe

    UCF Spanish Translator

  • Admin
  • PipPipPipPipPipPipPip
  • 846 posts
  • Gender:Male
  • Location:Guadalajara/Mazatlan, Mexico.
  • Interests:Electronics, SW development, automotive. Swim->bike->run

  • Calculators:
    Algebra FX2.0 (R.I.P.), Classpad 300

Posted 20 September 2005 - 08:31 PM

@kilburn: I dont had time for watch what you did but seems cool. Contact me via any IM for talk and see if i can do the spanish translation. My free time its very reduced here, i help my family, i'm searching for a job (still planing move from my city, hopefully i have plans A, B and C) and i want to stay close to my family (specially my 6 and a half years old nephew). So i will try to do my best and help with this.

I use gaim so you can contact me via MSN, AIM, ICQ, Y!, google talk...

#7 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 21 September 2005 - 04:14 PM

Here is the corrected version B) KaosGenerator_English.rar

SoftCalc >> I added the tips you gave me. I don't know yet if it is faster, because I don't have time to try it.
Pleaaaase!!!! Help me to solve the zoom problem!! :banghead:

#8 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 21 September 2005 - 10:43 PM

On thing I've noticed a crash caused by a memory leak in the following function...

void FractalWindow::Capture()
{


PegRect block = mClient;
PegCapture* capt = new PegCapture();
Screen()->Capture(capt, block);
pict = capt->Bitmap();
BeginDraw(pict);
Line(1, 0, 1, 192, WHITE);
Line(158, 0, 158, 192, WHITE);
EndDraw(pict);
win->pict = pict;

}



You are creating a new capture which then creates a new bitmap, but the old ones are never deleted.

My suggestion....
* Save the PegCapture object pointer in a member variable.
* Decide which parent object will own this
* Initialize the variable to NULL in the constructor.
* In the FractalWindow::Capture() method check if the variable is NULL. If not, then delete the old version before creating and assigning a new one.
* Finally, in the destructor if the variable is not NULL then delete it.

#9 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 22 September 2005 - 05:43 PM

Thank you. And did you find the cause of the zoom problem ? :banghead: :profanity: :knife:

And do someone know how to draw Markus-Lyapunov's fractal? I find these fractals really beautiful! :)

#10 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 22 September 2005 - 05:45 PM

Here is the corrected version B) KaosGenerator_English.rar

SoftCalc >> I added the tips you gave me. I don't know yet if it is faster, because I don't have time to try it.
Pleaaaase!!!! Help me to solve the zoom problem!! :banghead:

I've fixed the zoom/pan bug, and I fixed the "zoom in" bug. I also fixed the memory leak.

You were also using mReal in some places and mClient in others. These are almost the same, but not exactly the same. mReal is the actual size of the PegThing, including any borders. mClient is the rectangle that can be draw in, which does not include the borders. If there are no borders then they will be the same, but you should always use mClient if you ae drawing in the window.

I made changes through out the source, so it isn't easy to give you only the different. Do you use CVS? If you do, then it is easy to merge changes. If not, you can send me your latest source and I will merge in my changes into your latest source.

#11 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1554 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Cinema, Programming, Music and a lot of thing...

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 23 September 2005 - 12:39 AM

And do someone know how to draw Markus-Lyapunov's fractal? I find these fractals really beautiful! :)



There: Introduction to Markus-Lyapunov fractals

#12 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 23 September 2005 - 05:44 AM

I've fixed the zoom/pan bug, and I fixed the "zoom in" bug. I also fixed the memory leak.

I made changes through out the source, so it isn't easy to give you only the different. Do you use CVS? If you do, then it is easy to merge changes. If not, you can send me your latest source and I will merge in my changes into your latest source.

I put the add-in with the fix to the zoom here. I fixed the zoom by writing a few functions to convert between world and screen coordinates. This made life much easier. ;)

http://www.cpsdk.com...lish_floats.rar

Let me know if you have changed your source code since you gave it to me. If you did, send me your new source and I can merge in my changes very easily.

I also noticed when you zoom way in it becomes boxy. I think this is due to round-off errors. Why did you use float instead of doubles or OBCD? I think using either of these will help.

#13 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 23 September 2005 - 06:37 AM

I also noticed when you zoom way in it becomes boxy. I think this is due to round-off errors. Why did you use float instead of doubles or OBCD? I think using either of these will help.

OK, I don't know when to stop. I figured, why fix zoom if you can't zoom in very far? :D I updated your code so it now uses doubles instead of floats, and you can zoom in extremely far now. If you were to change it to OBCDs you can probably zoom in even farther.

The updated code is...
http://www.cpsdk.com...tor_English.rar

#14 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 25 September 2005 - 04:26 PM

So how goes the add-in?

#15 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 25 September 2005 - 05:42 PM

I finished it!!! :greengrin:
Thanks to your help, but I solve the zoom problem before reading this topic! :P
I deleted xorg and yorg.

First I posted the source code on the French forum, and two months later, nobody helped me. And there, I've just posted the program, that you go immediately help me!! :lol2:

I am writing the manual, when I'll finish it, I will put it on www.casiocalc.org ;)

P.S. : I never use OBCD's because they are too slow.

I someone has suggestions, please tell me them.

#16 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 30 October 2005 - 03:59 PM

Kaos Generator 1.01 is released! :beer:
:arrow: http://www.classpad....hp?id=236&cat=3

#17 omegavirus

omegavirus

    Casio Freak

  • Members
  • PipPipPipPip
  • 150 posts
  • Gender:Male
  • Location:Morelia, M?xico

  • Calculators:
    ClassPad 300

Posted 31 October 2005 - 03:19 AM

Very nice add-in, I was waiting for the oficiall realice a long time ago...

Which is your new proyect? you have talent to make very cool add-ins...

#18 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 31 October 2005 - 07:42 AM

I don't know exactly. I have so many projects.

I began this game: http://kilburn.free.fr/mrworm.cpa
It's a snake game, but a bit particular. Use <- and -> only. ;)

#19 omegavirus

omegavirus

    Casio Freak

  • Members
  • PipPipPipPip
  • 150 posts
  • Gender:Male
  • Location:Morelia, M?xico

  • Calculators:
    ClassPad 300

Posted 01 November 2005 - 05:05 AM

I had already saw one of your games called worms and the cheat that is has is very fun :lol2: I read the posts of the CPLua topics, I will see the add-in and let you know if I found bugs :)

#20 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 01 November 2005 - 04:25 PM

I am pleased to know you like my add-ins. I am working in a new version of Kaos Generator. Maybe you could add me to you MSN contacts : classpadcrazy AT hotmail.fr
...so you will help me to translate all that in spanish. :)

And if someone know how to trace Markus-Lyapunov fractals, please tell me... ;)

(I am 14, so don't talk too much about limits, derivatives, etc... :lol2: although I have a bit knowledge about that :rolleyes: )

#21 TacoFred

TacoFred

    Casio Freak

  • Members
  • PipPipPipPip
  • 145 posts
  • Location:NJ
  • Interests:I LOVE STARCRAFT BROODWAR<br />MUHAHAHAHAHAHAHAHAHAHAHA

  • Calculators:
    cfx 9850gb+, fx 115MS, ClassPad 300, TI-89 Titanium

Posted 02 November 2005 - 10:32 AM

bah i did calculus 3 when i wuz 14...but ima nerd
you're quite good at programming :) im starting to learn at the moment

#22 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 05 November 2005 - 04:46 PM

omegavirus>>What's the strange message you sent me at Hotmail??? I understood nothing!! It seems to be important... :huh:

#23 omegavirus

omegavirus

    Casio Freak

  • Members
  • PipPipPipPip
  • 150 posts
  • Gender:Male
  • Location:Morelia, M?xico

  • Calculators:
    ClassPad 300

Posted 06 November 2005 - 01:27 AM

jaja sorry it is a chain in spanish and it says that the messenger is going to close some acounts because they have a lot o users that have acount but they dont use it :P

About Mr worm it would be better if the counter of things tha :) t the worm eat is on the status bar because at some point in the game you can't see it anymore

#24 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 06 November 2005 - 03:39 PM

ok

#25 MicroPro

MicroPro

    Casio Overlord

  • Deputy
  • PipPipPipPipPipPipPip
  • 640 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    Casio ClassPad 300

Posted 22 December 2005 - 12:23 PM

Hello, about your Fractal program:
I think if you add an option to display more colors (e.g black, white, and a gray color) Fractals will look more beautiful.
Thanks. :)

#26 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 22 December 2005 - 12:57 PM

Hello, about your Fractal program:
I think if you add an option to display more colors (e.g black, white, and a gray color) Fractals will look more beautiful.
Thanks. :)


I already had this idea but, grayscales are not supported yet. I'm still waiting for Gaumerie who started to write a grayscale library




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users