Sign in to follow this  
Mirza Kurtiz

Simple graphics with simple functionality

Recommended Posts

Mirza Kurtiz    104

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? :D 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.

Please give me your advice on this one. I have no clue where to start.

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










Share this post

Link to post
Share on other sites
Nik02    4348

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.

Share this post

Link to post
Share on other sites
Nik02    4348

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


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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this