Jump to content

  • Log In with Google      Sign In   
  • Create Account


Brother Bob

Member Since 26 Nov 2001
Offline Last Active Today, 05:19 PM
*****

#5130908 Calling a virtual function, illegal call of non-static member function?

Posted by Brother Bob on 12 February 2014 - 04:50 PM

Access specifiers are per class, not per object. Since your static TheadRoutine is a member of the WorkerThread class, it has access to everything in any WorkerThread object and can therefore call the private ThreadFunction on the typecast param pointer. Consider what would happen to, for example, the assignment operator or the copy constructor if they could not access private members of the object to copy from.




#5129598 fractal result by accident

Posted by Brother Bob on 07 February 2014 - 08:50 AM

Your function F(x,y) is a continuous function, but when you create your image you sample F(x,y) at discrete points. Each pixel in the image is a sample point of the function. In your first post, for example, you sample F(x,y) at roughly 950 discrete points along both the X and the Y axis. The interference is not in F(x,y) itself, but comes from sampling it at discrete points.

 
Dont think so, Could you explain this, lets say that you are taking
some point x, y = 0.1776527, 0.23876 You say that color value of this point depends on the grid resolution? IMO F(x,y) values are grid independant
Interference does not happen in one single sample point. It is the interaction between neighboring sample points. You cannot say anything about interference in one point. It is irrelevant what the value is in one point of the function.


#5129584 fractal result by accident

Posted by Brother Bob on 07 February 2014 - 07:55 AM

 

 

for me i may repeat it seem this is not worse fractal than sierpiński carpet


I have no idea why you still think your image is a fractal. The way I see it, what you plotted is a couple of hundred concentric circles, which when sampled with a regular grid result in a spectacular moiré pattern. It's not like we are saying your image isn't pretty: It just has little to do with fractals.

I found this link: http://www.nahee.com/spanky/www/fractint/circle_type.html (Notice the "not a fractal" part.)

 

 

I think it is unrelated to sampling on the grid- all in all this is well defined 

F(x,y) function for x,y are real,  - so sampling to a grid is not important imo, it just blurs the details, dont you think?

 

Very good info in this link, (i was searching for such references) though here is written ". The resulting image is not a fractal because all detail is lost after zooming in too far. "

Im not sure if this is true, if one will raise the frequenzy of palette

i think the detail depth will probably increase to infinity - so it probably depends how you  define this construct 

 

Your function F(x,y) is a continuous function, but when you create your image you sample F(x,y) at discrete points. Each pixel in the image is a sample point of the function. In your first post, for example, you sample F(x,y) at roughly 950 discrete points along both the X and the Y axis. The interference is not in F(x,y) itself, but comes from sampling it at discrete points.




#5129265 fractal result by accident

Posted by Brother Bob on 06 February 2014 - 03:53 AM

This is not interference involved also not precision errors or something, this is just a stable way of colorisation of the sphere also i think it has an infinite indepth complexity here (if you wil rize up the palette frequenzy to infinite, as i said, ), here is some 'zoomed' example yet

 The circles form one pattern, and the pixels forming the discrete sampling grid is the second pattern. The interference is implicit from the intersection between the two patterns when you sample the continuous circle pattern at the discrete pixel grid.
 

attachicon.gifsome.jpg

Overlay that image and the one from your first post and you'll see that the interference patterns, or fractals if you want, are not the same; neither at the equivalent scaled location or at the equivalent scaled size. Your patterns are thus resolution dependent. That's precisely how interference works.




#5129142 fractal result by accident

Posted by Brother Bob on 05 February 2014 - 03:21 PM

You asked about an effect that was unknown to you and I gave an answer about an effect that is known to me. You don't have to take my word for it, but I did give you experiments you can perform to either enforce or refute my answer. I have at least provided examples to back my answer up and mentioned experiments you can do to see for yourself. It is not about just believing in my word at that point.




#5129107 fractal result by accident

Posted by Brother Bob on 05 February 2014 - 01:08 PM

Here's a link for you describing the effect you're getting: clicky. There are some examples near the end showing pretty much exactly your results.

 

You may also be able view the effect, including zooming, on the resolution chart on page 4 in the PDF. The small part in the middle with some circular patterns shows the exact same effect on my screen when zooming out to view the page as a whole. This is because the resolution of my screen is too small to capture the frequencies of the circles. As I zoom in on that part of the figure, the circles become clear and the aliasing effect disappear when the circles are rendered at a higher and higher resolution.

 

Clearly an aliasing effect and nothing fractal about it.




#5129102 fractal result by accident

Posted by Brother Bob on 05 February 2014 - 12:55 PM

Why "I think" and "I suspect" when you can try to verify your claims and be completely confident instead? Zoom in on some part of the image showing a fractal behavior. If it is indeed a fractal pattern, the pattern should remain stable as you zoom in and recalculate the region at a higher resolution.




#5129087 fractal result by accident

Posted by Brother Bob on 05 February 2014 - 11:50 AM

Zoom in on those structures and see what happens when you get closer to them. If the patterns change as you zoom in, then this is definitely just normal sampling aliasing. The fact that you only calculate a distance and transforms it into some color means that the pattern should just be circular rings around a center point, but circular patterns with too high frequency for the display produces those particular patterns. Nothing fractal at all about it.




#5129080 fractal result by accident

Posted by Brother Bob on 05 February 2014 - 11:28 AM

Looks like normal sampling aliasing or interference patterns. As the frequency of the rings increase, they approach and pass the limit at which you sample the rings at the pixels.




#5128765 Bit mask math

Posted by Brother Bob on 04 February 2014 - 11:26 AM

Although I share the concerns that everyone else has about the readability and maintainability of this code (I'd stick with something clear over something short)... it's also worth pointing out that pretty much every alternate form that people have posted does not have the same effect as the original code. If you do anything with id after the code that you posted, then the final value of id varies, depending on whether or not it had the Pickable flag set. (Highlighted is only cleared if id had any bit other than pickable). In fact, I'm beginning to seriously doubt that this code does what you think it does. What were you actually trying to do with this logic?

I actually thought so too that the solutions are different, until I realized that the if-statements clears a bit but checks the entire value and not just that cleared bit. The only way to break on the first of the three if statements is if no bits at all are set in the original value. You are right that highlighted is only cleared if something other than pickable is set, but if nothing else is set then highlighted cannot be set either so there's nothing to clear in the first place (nor is there anything that can be equal to 200).

 

Whether you clear them all at the same time, as MARS and iMalc suggested in their solutions, or one at a time as MARS did in his original code actually makes no difference. All codes effectively clear both bits and checks the remaining value for 200. The net result is the same in all cases, and that includes whether the last if-statement (=200) is take or not, and what the final value of id is.

 

In Krohm's variant though it makes a difference since it doesn't modify anything at all. And, of course, like most other here I prefer a non-modifying variant.




#5128553 hand-linking to stdlib.h in mingw

Posted by Brother Bob on 03 February 2014 - 03:40 PM

for example i got some call to   SetWindowText(hwnd, text);

i was trying to delete windows.h and declare

 

 int __stdcall SetWindowText(void*, char*);

 
but gotlinker error
 
undefined reference to `SetWindowText(void*, char*)@8'
 
how i should write it? where to find a raw declatarion for this, raw declaration i could type here?

 

The symbol SetWindowText is itself a macro than expands to either SetWindowTextA or SetWindowTextW. Most functions that take strings have A and W variants for char * and wchar_t * strings, respectively.




#5128433 c++11 move constructor question

Posted by Brother Bob on 03 February 2014 - 08:41 AM

 

Correct me if I'm wrong, but there's little point in calling std::move on an lvalue (as is the case in your code).
 
It'd make more sense like this:


vector<Test> v;
v.push_back(std::move(Test()));

You are wrong. In your example you don't even need the std::move because 'Test()' is an xvalue as an expiring temporary. The whole point of std::move it to allow it on what would usually be lvalues.

 

Also, if the intention is to construct a temporary object just to pass it to push_back, you should instead use emplace_back to construct it in-place inside the vector and skip the temporary object entirely.




#5128377 Is a font the same as a glyph.

Posted by Brother Bob on 03 February 2014 - 03:35 AM

Basically, a code point is an abstract numerical value representing a character. The character 'A' has the ASCII-code point 65. Computer works with code points, and the monitor displays a pattern of pixels that forms the shape of a character that you as a human can recognize.




#5128040 OpenGL Alpha problem.

Posted by Brother Bob on 01 February 2014 - 04:47 PM

If the two overlapping object have the same alpha, then just write the alpha channel to the frame buffer without any kind of blending at all. The last object you draw already contains exactly the alpha channel you expect as a final result.




#5127567 Is a font the same as a glyph.

Posted by Brother Bob on 30 January 2014 - 03:29 PM

A typeface is a family, with variants such as bold, italic, smallcaps, and so on. As an example, "Arial" is a typeface, while the bold, italic and smallcaps variants of Arial are fonts. A font is a collection of glyphs, where a glyph is the single figure representing, say, a character or some other symbol.






PARTNERS