[QUOTE=Laserbeams;25811638]But if the radius of the circle isn't 1, should I multiply the cos t and the sin t by the radius ?[/QUOTE]
Just to elaborate on everything:
Tangent( Angle ) = Opposite / Adjacent
Cosine( Angle ) = Adjacent / Hypotenuse
Sine( Angle ) = Opposite / Hypotenuse
(The Cat Sat On An Oven And Howled Horrifically.)
Where the hypotenuse is the radius, the opposite is the X displacement and the adjacent is the Y displacement. (Yes this is opposite from Darwin226's image, however I always count the angle starting from "north".)
So if we look at the formulas, we get:
Sine( Angle ) = X / Radius
Cosine( Angle ) = Y / Radius
Rearranged:
X = Sine( Angle ) * Radius
Y = Cosine( Angle ) * Radius
This gives the displacement from the centre of the circle to the point represented by Angle (Usually in radians.) going clockwise from north. If you want to move the circle then just add to the displacement for all of the points and if you want to rotate the circle (If you're just drawing an arc for example.) then just add to the angle for every point.
To convert from degrees to radians use:
Radians = Degrees * Pi / 180
I think it's a bad practice to count the angle from north.
Game libraries that have rotation and angles built in will most likely use the angle starting from the east and that will screw with your head.
(I'm thinking Flash when I say that)
[editline]2nd November 2010[/editline]
Content time:
[media]http://www.youtube.com/watch?v=d0wpDtAagIY[/media]
Wondering how to do lighting...
"Tangent( Angle ) = Opposite / Adjacent
Cosine( Angle ) = Adjacent / Hypotenuse
Sine( Angle ) = Opposite / Hypotenuse
(The Cat Sat On An Oven And Howled Horrifically.)"
Interesting way of remembering it
I was taught SOH CAH TOA (pronounce it phonetically as "sohcahtoa")
Sin = Opposite / Hypotenuse
Cos = Adjacent / Hypotenuse
Tan = Opposite / Adjacent
[QUOTE=neos300;25811210][img_thumb]http://imgkk.com/i/__qai6.png[/img_thumb]
tile system in 20 minutes fuck yeah
[cpp]
#include <iostream>
#include <string>
#include <SFML/Graphics.hpp>
#include "Game.h"
//EVERTHING IS 32X32
int main()
{
Game gam;
gam.init("wee", 800, 600);
sf::Image img;
img.LoadFromFile("tile.png");
Tile t;
Tile s;
Tile q;
Player me;
t.init(img, 0, 0);
s.init(img, 0, 1);
q.init(img, 1, 0);
gam.addtile(t, 0, 0);
gam.addtile(s, 0, 1);
gam.addtile(q, 1, 0);
sf::Image play;
play.LoadFromFile("player.png");
me.init(play, 1, 1);
gam.SetPlayer(me);
gam.draw();
int i;
std::cin >> i;
}
[/cpp]
I'll add factory functions for tiles later so I can remove a bunch of that code.
My RPG game/engine is coming along nicely.[/QUOTE]
clean code, nop
Content!
[IMG]http://i55.tinypic.com/20ggwg3.png[/IMG]
Finally have an infinite amount of lights working, as well as the program not crashing when the shapes dont intersect with the light :3
[QUOTE=Icedshot;25813562]Content!
[img_thumb]http://i55.tinypic.com/20ggwg3.png[/img_thumb]
Finally have an infinite amount of lights working, as well as the program not crashing when the shapes dont intersect with the light :3[/QUOTE]
All you need is falloff on the light, and that thing where you blur the borders of the shadow as it gets further from the object (forgot what it's called), and it's perfect!
[editline]2nd November 2010[/editline]
Penumbras or something.
Does anybody know if it works to pass a cookiecontainer from a function to function?
[QUOTE=Chris220;25811649]Instead of "int i; std::cin >> i;" I usually prefer to do "std::cin.get();"
Works the same, but will accept empty inputs as well[/QUOTE]
[url]http://www.daniweb.com/forums/post438070.html#post438070[/url]
[QUOTE=Chris220;25811649]Instead of "int i; std::cin >> i;" I usually prefer to do "std::cin.get();"
Works the same, but will accept empty inputs as well
[editline]2nd November 2010[/editline]
[/QUOTE]
true story. I'm using getch(); from conio.h
[QUOTE=Icedshot;25813562]Content!
[img_thumb]http://i55.tinypic.com/20ggwg3.png[/img_thumb]
Finally have an infinite amount of lights working, as well as the program not crashing when the shapes dont intersect with the light :3[/QUOTE]
What are those triangles and that single red line behind the actual 'shadow shapes'?
[editline]2nd November 2010[/editline]
mah automerge :argh:
[editline]2nd November 2010[/editline]
mah automerge :argh:
Why do your screenshots always have thick red borders?
[QUOTE=CarlBooth;25814750]Why do your screenshots always have thick red borders?[/QUOTE]
Snipping tool.
[QUOTE=Pirate Ninja;25814971]Snipping tool.[/QUOTE]
Use [url]http://gyazo.com/en[/url] or something.
Edit: Oh wait. I thought you were red-borders guy. Whatever.
In Snipping Tool, you can turn the red borders off:
Options > Uncheck "Show selection ink after snips are captured"
Real men use ZScreen.
[QUOTE=Dj-J3;25816563]Real men use ZScreen.[/QUOTE]
I find Gyazo to be faster and more convenient when on the taskbar, but then, I haven't really used Zscreen that much.
[QUOTE=Dj-J3;25816563]Real men use ZScreen.[/QUOTE]
Real men hold alt and press prnt scr...
[editline]2nd November 2010[/editline]
[QUOTE=thomasfn;25813685]All you need is falloff on the light, and that thing where you blur the borders of the shadow as it gets further from the object (forgot what it's called), and it's perfect!
[editline]2nd November 2010[/editline]
Penumbras or something.[/QUOTE]
It might sound wierd, but I actually dislike the effect of penumbras. I like seeing the hard edge of the light. If it's antialiased then it's all good.
I've been working on my own login system for Zombie Outrage 2. I knew that just entering a random username would get boring.
It's not going to be released right now, but when it is I'll have to clear the original score list. But thank you all for playing, it means a lot. : )
The user file currently holds your name, password, total play count, and total time survived. But this can be added to since the way I made it is flexible and is able to work when having things add to.
The passwords are safe and hashed. And example of a file in my system would be this:
[code]
//Austech
pass:5f4dcc3b5aa765d61d8327deb882cf99;ZO2PlayCount:2;ZO2TotalTime:17476;
[/code]
[media]http://i51.tinypic.com/orqhwj.jpg[/media]
[media]http://i55.tinypic.com/14skyo8.jpg[/media]
In Win32 how can I add progress bars into a Listview? I've looked at custom drawing but, I can't get a post-paint event from a sub-item.
[QUOTE=DevBug;25817635]In Win32 how can I add progress bars into a Listview? I've looked at custom drawing but, I can't get a post-paint event from a sub-item.[/QUOTE]
You have to do it with custom draw calls and it ends up looking like shit.
You're best using WPF if you want that kind of effect.
[QUOTE=xAustechx;25817457]
[code]
//Austech
pass:5f4dcc3b5aa765d61d8327deb882cf99;ZO2PlayCount:2;ZO2TotalTime:17476;
[/code]
[/quote]
text: password
maybe use a different hashing method?
[QUOTE=CarlBooth;25817735]You have to do it with custom draw calls and it ends up looking like shit.
You're best using WPF if you want that kind of effect.[/QUOTE]
No MFC, No WPF, No Winforms.
Mind telling me how I can get post-paint events for a sub-item?
Could I just skip the default and paint it myself in pre-paint?
[QUOTE=Richy19;25817755]text: password
maybe use a different hashing method?[/QUOTE]
What's wrong with that? The point of the text behind it is to filter out what is what. That way I can easily grab what's in the file.
For example, when I want to log in, I check if the hash values both match, like so:
[code]
if($pass == getFieldVal($user, "pass:"))
{
//Do stuff
}
[/code]
ohh sorry think i read it wrong :v:
Cool story bro.
[img]http://localhostr.com/files/72c224/Music-Vine.png[/img]
[QUOTE=Richy19;25818277]ohh sorry think i read it wrong :v:[/QUOTE]
It's okay. : )
I know that this doesn't really compare at all to everything thing else here, but I'm really happy that I started to learn programming, I'm starting with c++, and I like it a lot.
(I'm obviously learning from a book)
[img]http://imgur.com/1OzJN.png[/img]
Please tell me which book you are learning from so I can buy a copy and set it on fire.
[QUOTE=r4nk_;25821733]Please tell me which book you are learning from so I can buy a copy and set it on fire.[/QUOTE]
How would you suggest I learn then? I don't really know where to start besides that
I think books are a fantastic way to learn, you just have to make sure you get a reputable book
Sorry, you need to Log In to post a reply to this thread.