Since everybody is posting patterns, [url=http://s206.photobucket.com/albums/bb161/itsbth/PHP%20Pattern%20Making/]here[/url] is something I made in PHP about a year ago.
[url=http://s206.photobucket.com/albums/bb161/itsbth/PHP%20Pattern%20Making/][IMG]http://i206.photobucket.com/albums/bb161/itsbth/PHP%20Pattern%20Making/Perspective.png[/IMG][/url]
Jumping on the fractal bandwagon, I wrote this few years ago:
[IMG]http://filesmelt.com/dl/bb1.PNG[/IMG]
It's that buddha-related fractal (I recall it's made by displaying how many iterations it takes for certain iteration to leave the boundaries, not just IF it leaves boundaries)
I decided to see how easy it was to emulate UnrealScript's states in CLOS.
[img]http://i.imgur.com/BwQV8l.png[/img]
Not that large, actually, although using thunks isn't the obvious choice in a Lisp-2. It's rather like APL where it takes me three days just to get this correct.
I need some maths help. My maths is failing me.
Say I'm drawing a series of lines along the x axis like this
|||
Is there an established formula to draw a perfect curved corner, by using x to determine the height of the line... so it's like..
|i.
The only way I can think of doing it is by using atan2 to work out the angle, then using cos to get the height of that angle. But that seems lousy.
Pythagoras?
y = sqrt(r^2-x^2)
-snip-
What is r?
[QUOTE=garry;20154364]What is r?[/QUOTE]
Radius for the rounded corner.
[QUOTE=turby;20154361]ohlol. go back to year 8 when they were teaching you Pythagoras' theorem bro[/QUOTE]
That's from the equation of the circle, which follows the Pythagorean theorem.
Oh man thanks, I never really understood the Pythagoras stuff in school
-schnipples-
[QUOTE=turby;20154427]Well whatever you do, change his minus to a plus.[/QUOTE]
Why would you do that?
r^2 = x^2 + y^2
That is Pythagoras Theorem, therefore:
y^2 = r^2 - x^2
y = sqrt(r^2 - x^2)
[QUOTE=turby;20154427]Well whatever you do, change his minus to a plus.[/QUOTE]
Uhh.. We're not calculating the hypotenuse.
[QUOTE=noctune9;20154443]Uhh.. We're not calculating the hypotenuse.[/QUOTE]
okidokie, read the the word 'pythagoras' and jumped to a conclusion
Yeah Pythagoras != Pythagorean
[QUOTE=garry;20154405]Oh man thanks, I never really understood the Pythagoras stuff in school[/QUOTE]
I have no idea how you made botch / gwen, I mean, with all that shadow mapping, normal mapping, and then there is gmod...
I call sorcery, we must burn garry at the stake.
*Snip* Forgot to refresh before posting
[QUOTE=BlackPhoenix;20152938]Jumping on the fractal bandwagon, I wrote this few years ago:
-snip-
It's that buddha-related fractal (I recall it's made by displaying how many iterations it takes for certain iteration to leave the boundaries, not just IF it leaves boundaries)[/QUOTE]
Best looking one in entire thread.
[QUOTE=Jallen;20154931]I have no idea how you made botch / gwen, I mean, with all that shadow mapping, normal mapping, and then there is gmod...
I call sorcery, we must burn garry at the stake.[/QUOTE]
I know, it's insane. I can only really understand stuff if I have a use for it. I don't retain maths in my head. I learn it to make a function then that's it, I just use the function from then on.
[QUOTE=garry;20155189]I know, it's insane. I can only really understand stuff if I have a use for it. I don't retain maths in my head. I learn it to make a function then that's it, I just use the function from then on.[/QUOTE]
I have to admit, I also do the same with any math stuff. I spend some time converting it into a function then I just use it as a "magic" function.
[QUOTE=iPope;20155816]I have to admit, I also do the same with any math stuff. I spend some time converting it into a function then I just use it as a "magic" function.[/QUOTE]
AKA structured programming.
[QUOTE=Jallen;20154931]I have no idea how you made botch / gwen, I mean, with all that shadow mapping, normal mapping, and then there is gmod...
I call sorcery, we must burn garry at the stake.[/QUOTE]
You speak out what I'm thinking all the time :D
[sp]Both statements.[/sp]
:v:
[QUOTE=Namelezz!;20156863][img]http://www.cubeupload.com/files/df0000moredeadpeopleandblo.png[/img]
Blood. [highlight]BLOOOOOOOD[/highlight].[/QUOTE]
Why is it so brown...
[editline]05:07PM[/editline]
[QUOTE=s0ul0r;20156465]You speak out what I'm thinking all the time :D
[sp]Both statements.[/sp]
:v:[/QUOTE]
:buddy:
It's not brown on my screen.
Same color:
[img]http://i48.tinypic.com/2rclrww.jpg[/img]
red:167-----hue:0
green:0-----sat:100
blue:0-------val:65
It is only red. There is no other color in this color than red. I don't see how you see it as brown.
[QUOTE=luck_or_loss;20157908]It's not brown on my screen.
Same color:
[red]
red:167-----hue:0
green:0-----sat:100
blue:0-------val:65
It is only red. There is no other color in this color than red. I don't see how you see it as brown.[/QUOTE]
It does [b]look[/b] brown. Has to do with the surrounding colours.
[QUOTE=luck_or_loss;20157908]It's not brown on my screen.
Same color:
[img]http://i48.tinypic.com/2rclrww.jpg[/img]
red:167-----hue:0
green:0-----sat:100
blue:0-------val:65
It is only red. There is no other color in this color than red. I don't see how you see it as brown.[/QUOTE]
Because it is too dark and because of the surrounding colours.
Displaying the colour on its own is useless, surrounding colours play a huge role in how you see colour.
ninjad
It looks the same to me in the screenshot and on the page
[editline]08:54PM[/editline]
Then again I'm using my laptop with a small resolution
Just wrote a high-performance function to switch the endianness of any object:
[cpp]
#ifndef ENDIANNESS_HPP
#define ENDIANNESS_HPP
#include <algorithm>
template<typename T>
T switch_endianness(T i);
template<typename T, int i>
struct Endianness
{
static void swap(char* array)
{
std::swap(array[(sizeof(T) - i)], array[i-1]);
Endianness<T, i-1>::swap(array);
}
};
template<typename T>
struct Endianness<T, 0>
{
static void swap(char* array){}
};
template<typename T>
T switch_endianness(T i)
{
char* array = reinterpret_cast<char*>(&i);
Endianness<T, sizeof(T)/2>::swap(array);
return i;
}
#endif[/cpp]
I didn't manage to make switch_endianness a templated friend function of Endianness with GCC; it didn't complain about the friend declaration but still complained that Endianness::swap was private. If anyone knows how to properly use friend in this case, please tell me!
Usage:
[cpp]
#include <cassert>
#include "endianness.hpp"
int main()
{
unsigned short i = 0xAAFF;
i = switch_endianness(i);
assert(i == 0xFFAA);
i = switch_endianness(i);
assert(i == 0xAAFF);
return 0;
}
[/cpp]
(thanks to gparent for the idea of using std::swap)
[QUOTE=jA_cOp;20158655]Just wrote a high-performance function to switch the endianness of any object:[/QUOTE]
Pfft. Full credits:
gparent:
-Coming up with idea
-Initial implementation
-Performance testing
-Coming up with sizeof() and template idea
jA_c0p:
-Working with C++'s template metaprogramming to come up with The Premiere Unique Switchendianness Experience
=D
[QUOTE=gparent;20158787]Pfft. Full credits:
gparent:
-Coming up with idea
-Initial implementation
-Performance testing
-Coming up with sizeof() and template idea
jA_c0p:
-Working with C++'s template metaprogramming to come up with The Premiere Unique Switchendianness Experience
=D[/QUOTE]
:ninja:
Sorry, you need to Log In to post a reply to this thread.