• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Simple graphics with simple functionality

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1rotatingroastedrat  Members

Posted 31 July 2014 - 07:25 PM

Hi y'all!

First of all let me tell you a little something about my knowledge and skills and then I'll move on to what I want to do.

So, I know all the basics of c,c# and c++...if you'd pick up a book like, say, "thinking in c++", there would be virtually nothing that I haven't covered...except funnily enough I'm a bit shaky on virtual functions. Whatever...

I don't have that much experience with actually writing code and I guess most of you will think that it is a serious shortcoming if I claim to know alot.

Doesn't matter that much to me tho'. I feel like, as long as I'm hot on the theory, the practice won't be that tedious. I have read "code complete" and I am totally aware of all the things the author tries to express.

Anyway, what about math, which is important when it comes to graphics? My math understanding is very high - linear algebra and such? You needn't bother.

So let's move on then...what is it I want to do?

I don't know that much about DirectX programming. But I want to stress that my aim is not to make super-advanced graphics.

Look folks, all I want to do is make, eg., a dot that rotates in a visual path of an oval, maybe let's say, from the input of the keyboard. Let's add some plain vertical and horizontal movement of a few levers side-by-side that find their position according to the angle of the dot.

I dunno...why not throw in some explanatory mathematical functions that present themselves in a certain typefont and size in the upper right corner who describe the processes present?

You know what I'm saying? Nothing fancy-shmancy just pure old math. And basic directx functionality.

In time I want to move on to create the simplest, most stripped of game-engines.

Some online tutorials maybe (I can't seem to find any that suit my purposes)? A book you can recommend?

Whatever enters your mind regarding this topic.

Thanks, be kind

/Mirza

### #2Nik02  Members

Posted 01 August 2014 - 04:57 AM

Rotation of graphics in 2d is very easy to implement by using sin, cos and other trigonometry functions.

Consider that t is a parameter that goes from 0 to pi * 2.

x = cos (t) * radius

y = sin (t) * radius

Now, if you plot the x and y for every t, you get a full circle. An ellipse is just a scaled circle, so scale either the x or y by a constant factor to get an ellipse. If you want to move the said ellipse, just add constant scalars to x, y or both.

For slightly more advanced stuff, linear algebra could be your next destination. Vectors, matrices and such are very useful in graphics, and they are not very difficult to use once they "click" in your brain.

Niko Suni

### #3Nik02  Members

Posted 01 August 2014 - 05:02 AM

Regarding DirectX basics, have you read the tutorials on MSDN?

http://code.msdn.microsoft.com/windowsapps/Direct3D-Tutorial-Sample-08667fb0/view/SourceCode

Although this specific sample is for WinRT, the same basic concepts apply for C++/native dev (though in native, you have to do more work to establish the window and message loop).

Edited by Nik02, 01 August 2014 - 05:03 AM.

Niko Suni

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.