Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

alfred

Just New prgrammer

This topic is 5577 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. Im a boy of 13 years old. I want to learn C++ but i dont know what should I do. Im not surre what is DirecTX Or anything else. I learnt Java and thats all i nkow

Share this post


Link to post
Share on other sites
Advertisement
Hey, hi, I''m 12 years old, and I started to learn C++ just this year and already know VB .NET (but now I''m sure I have forgotten it ), but now I just got a beginner''s book and started learning... Most people here say get

1. C++ Primer
2. C++ For Beginner, The Complete Language, by Ivor Horton
3. Accelerated C++

Those are the most common these days!!! So get one of ''em and just plop on a sofa and start learning.

Oh and get a compiler, either Dev-C++ from www.blooshed.net.
Or buy Visual Studio .NET, if you''re rich enough...

BattleGuard

My hobbies:
Martial Arts, Computer/laptop, Listening to Linkin Park, Computer/laptop, programming, game-dev (that''s why the heck I''m on this site in the first place!!! And did I mention my computer/laptop???

Share this post


Link to post
Share on other sites
I''m 12, have been doing C++ for about a year now, and I used C++ for Dummies. Any questions I had were answered by www.cprogramming.com .

Scott Simontis
Engineer in Training
Have a nice day!

Share this post


Link to post
Share on other sites

I even feal young in he'' too And I''m 15.

Just curious, how much do you guys know? Any examples or something? One thing I know is, that I started when I was around 14, so just curious how far you''ve gotten yet...

Share this post


Link to post
Share on other sites
quote:

Jesus Krimeny this thread made me feel old at 21....


lol, i guess this won't make you feel any better but im 13, too
EDIT: forgot something-cowsarenotevil is 13 (i think),too.
quote:

Just curious, how much do you guys know? Any examples or something? One thing I know is, that I started when I was around 14, so just curious how far you've gotten yet...


well, what exactly are you talking about-programming,c++,math. I'll just assume you ment all of the above. i have programmed 2 games using c++ and ddraw and 2 games using c++ and D3D. i know alot of math. here's some code that is part of my game that im working on right now:

D3DXVECTOR2 quad[4]={...}; // parameter

D3DXVECTOR2* p=...; // parameter

D3DXVECTOR2 edgeCenter[4];
// find the center of the edges

edgeCenter[0].x=quad[0].x+(quad[1].x-quad[0].x)/2;
edgeCenter[0].y=quad[0].y+(quad[1].y-quad[0].y)/2;

edgeCenter[1].x=quad[2].x+(quad[3].x-quad[2].x)/2;
edgeCenter[1].y=quad[2].y+(quad[3].y-quad[2].y)/2;

edgeCenter[2].x=quad[0].x+(quad[2].x-quad[0].x)/2;
edgeCenter[2].y=quad[0].y+(quad[2].y-quad[0].y)/2;

edgeCenter[3].x=quad[1].x+(quad[3].x-quad[1].x)/2;
edgeCenter[3].y=quad[1].y+(quad[3].y-quad[1].y)/2;

D3DXVECTOR2 perps[4];
// short for perpendiculars :)

perps[0].x=-1*(quad[1].y-quad[0].y);
perps[0].y=(quad[1].x-quad[0].x);
perps[1].x=(quad[3].y-quad[2].y);
perps[1].y=-1*(quad[3].x-quad[2].x);
perps[2].x=(quad[2].y-quad[0].y);
perps[2].y=-1*(quad[2].x-quad[0].x);
perps[3].x=-1*(quad[3].y-quad[1].y);
perps[3].y=(quad[3].x-quad[1].x);

for(int i=0;i<4;i++)
{

D3DXVECTOR2 pointVec;
pointVec.x=p->x-edgeCenter[i].x;
pointVec.y=p->y-edgeCenter[i].y;

double length=sqrt(pointVec.x*pointVec.x+pointVec.y*pointVec.y);
pointVec.x/=length;
pointVec.y/=length;
length=sqrt(perps[i].x*perps[i].x+perps[i].y*perps[i].y);
perps[i].x/=length;
perps[i].y/=length;

double angle=pointVec.x*perps[i].x+pointVec.y*perps[i].y;
// find the acos of the ratio to get the angle

angle=acos(angle);

if(angle>((double)PI/2)||angle<0)
{
return 0;
}
}
return 1;

try and guess what the above code does...1...2...and 3. it sees if the point (p) is inside the quad (quad). and no, i didnt copy it out of a book or anything i coded that myself. oh, and on a side note, the quad vertices must be in this order:

1********2
* *
* *
3********4

EDIT again: < pre > tag got loose (i forgot the end tag


doh, nuts. Mmmm... donuts
My website

[edited by - brassfish89 on June 18, 2003 8:47:52 PM]

[edited by - brassfish89 on June 18, 2003 8:51:09 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!