Logo by MandelBRO - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. April 19, 2024, 11:34:53 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: yFractalExplorer - A Tribute to Fractint, and a question  (Read 2335 times)
0 Members and 1 Guest are viewing this topic.
yv3
Conqueror
*******
Posts: 149



WWW
« on: August 23, 2010, 09:55:52 PM »

Hello,

im new here. OK, first i explain the circumstances :).
Im a C++ Programmer since about 10 years, working for a small company in Germany. Making games was always my dream since ive played Amiga in my school time. So i started to make an uniqe ASCII Multiplayer game in my spare time. I began three times from scratch to finish the enigine that provides the rendering and user interface in nostalgic Text Mode. Its based on SDL and OpenGL, its fast and it works fine. I was stumbled about an article on Code Project, a guy rendered a simple mandelbrot in Windows Console Mode. I wanted tried it out with my engine and then my biggest (sub-)project began :). The Software i wrote, called yFractalExplorer is now nearly complete. It has also a Text User Interface like the old good Fractint, but provides an more intuitive Interface with some unique features. This is more like an Entertainment Application than a common Fractal Software. You don't need know any math. You relax and fly around mostly smoothly in realtime to an intresting place, modify the fractal with keypresses and modifiers and then explore the image in graphics mode with wonderful palettes and color cycling. There is no post processing, it is minimalistic.

There are still some things to do, like loading and saving parameters, a bar in rendering mode that shows the current palette for a short while, rendering to files and adding much more fractal types. I will keep you updated when it will be released in this and my own forum on yv3.bplaced.net. It is free Donationware.

If you are intrested plz give it a try and share your opinion and suggestions with me: http://yv3.bplaced.net/files/yFractalExplorer.exe
Check out this guy :) : http://yv3.bplaced.net/gallery/yFractalExplorer/yFractalExplorer_011.gif
Here are some Fractals that i discovered when i was developing the application: http://yv3.bplaced.net/gallery/yFractalExplorer/

But the reason i registered here was not to make advertisement, i wanted to ask you guys something ;) I have an ugly implemented rotation of the fractal because the rotation is always around the middle of the fractal. I am not bad programmer but i know only about math basics and some physics. I want that the viewport always rotates about the center of the screen, even if i change the position the rotation must still remain and then if i rotate again the rotation must be again around the center of the screen. The current code for the mandelbrot looks like this:

Code:
void yFractal::GetFractalColor4() 
{
static double cx, cy, x, y, prev_x, prev_y, x_tmp, y_tmp, cosrot, sinrot;
static int n;

if(m_Rotation==0.0) //Rotation off
{
cx=m_X1 + (double(m_X)*m_WidthFactor);
cy=m_Y1 + (double(m_Y)*m_HeightFactor);
}
else //Rotate
{
x_tmp=m_X1 + (double(m_X)*m_WidthFactor);
y_tmp=m_Y1 + (double(m_Y)*m_HeightFactor);

cosrot=cos(m_Rotation);
sinrot=sin(m_Rotation);

cx=(x_tmp * cosrot) - (y_tmp * sinrot);
cy=(y_tmp * cosrot) + (x_tmp * sinrot);
}

prev_x=0;
prev_y=0;

for(n=0; n<m_Iterations; n++)
{
x=cx + (prev_x*prev_x) - (prev_y*prev_y);
y=cy + (2.0 * prev_x * prev_y);

if( ((x*x)+(y*y)) < m_Magnitude )
{
prev_x=x;
prev_y=y;
}
else
{
m_C=int( float(n) * m_ColorPerIteration );
return;
}
}

m_C=0;
}

m_X and m_Y are global Variables for faster rendering, they are set before calling the function to obtain a color index of a specific screen position.

Must i use a rotation matrix? I've googled around but maybe because my english is not as good i couldn't find a solution for this problem. The formulas on Wikipedia are too long for me, i also have to have time to play around with my son :). So maybe you can provide me a simple solution for this problem. I would be appreciated.

Logged

Creator of yFract
Jesse
Download Section
Fractal Schemer
*
Posts: 1013


« Reply #1 on: August 23, 2010, 11:38:33 PM »

Hi and welcome,

The solution is that you rotate before adding the position, so the position stays unchanged.
That's all, these conversions are very counter intuitive, make all the opposite way then you would expect  wink
Logged
yv3
Conqueror
*******
Posts: 149



WWW
« Reply #2 on: August 25, 2010, 08:31:13 AM »

Thank you Jesse,

i have analyzed my code, the rotation was already before the movement but there was another bug, the rotation point was always around the center of the fractal, not the center of the screen. I fixed that quickly. But after that i had to deal with another problem that cost me 3 hours to solve  angry. For instance when the fractal was rotated about 180 degrees, the movement in horizontal plane was mirror inverted. So i had to apply the rotation also on the "Movement factor". But now it works perfectly and everything is fine. thank you.

BTW @all: Sorry i placed this post in the wrong board, i was to quick and did not realised that there are other boards after the advertisement in the main page. This should not happen again. Damn beer  snore
Logged

Creator of yFract
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
My tribute to Benoît Mandelbrot Announcements & News JosLeys 1 2037 Last post October 25, 2010, 10:45:11 PM
by Thunderwave
yFractalExplorer alpha released! Announcements & News yv3 7 4168 Last post November 24, 2010, 03:03:43 PM
by yv3
Tribute to Passageway Images Showcase (Rate My Fractal) yv3 1 909 Last post January 10, 2011, 10:59:14 PM
by Fractal Ken
yFractalExplorer Alpha 5 released Announcements & News yv3 0 2738 Last post April 03, 2011, 11:51:11 AM
by yv3
tribute to mandelbrot Images Showcase (Rate My Fractal) taurus 0 1381 Last post October 14, 2012, 08:30:54 PM
by taurus

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.16 seconds with 25 queries. (Pretty URLs adds 0.01s, 2q)