Question about animation...

Dijkstra

Member
Hello everybody! I'm trying to make a racing game in GM: Studio... I use pseudo - 3D method (car consists of several layers, lined up in y-axis, something like that):confused:. For this, I use script - draw3d:
Code:
////at future i'll use 'for' loops for that
sprite_amount = argument4

if sprite_amount >= 1 { draw_sprite_ext(argument0,argument1,argument2,argument3, 1,1,image_angle,c_white,1) }

if sprite_amount >= 2 { draw_sprite_ext(argument0,argument1+1,argument2,argument3-1, 1,1,image_angle + 1,c_white,1) }
/////and so on
and draw on screen like this:
Code:
draw3D(spr_tyre, 0, x, y, 11);
But here is a problem - My wheels are static, and this looks aren't cool:(. How can I animate or, maybe, spin them? Who has any ideas about this problem - advise , thanks in advance for your help )
(P.S. Is it necessary to do it in 3d ? Don't really want this to be honest )
I attach the project below, with GIF, just in case .
Please, help me:rolleyes:
2016-08-30_18-07-27.gif
https://drive.google.com/file/d/0BzoWUCLfHlo1Y2hYNDR4YW9QZnc/view?usp=sharing
 
T

TDSrock

Guest
In your script you have argument 1. Which is located at the second argument of draw_sprite_ext. Which is tied to the functions : subimg The subimg (frame) of the sprite to draw (image_index or -1 correlate to the current frame of animation in the object).

Changing the sub-image or the image rotation would be the easy solutions here.
 

Tthecreator

Your Creator!
You should just make a sprite. You're using a somewhat hard shape of wheels, since your wheels are slightly hexagonic (is that a word?).
Are those gray dot's supposed to represent light?
If not, you should give your texture some more "texture"...
Just add some lines to your wheel instead of a solid color. (you can take some random picture of the internet and use it as color pallete).
When that is done, you should "move" your lines, which might be slightly easier in your case since your weels are a hexagon. Add new lines on the beginning and use a lot of trail and error.

I'm not that artistic too, since I don't make sprites like this that often (I prefer the entire programming side), but I hope I helped you a little bit.
 

Dijkstra

Member
...
When that is done, you should "move" your lines, which might be slightly easier in your case since your weels are a hexagon. Add new lines on the beginning and use a lot of trail and error.
I'm not really understand how to do this, because basically, without this fake-3d look, I have something like this:
Runner_2016-08-30_23-24-19.png
And i have several images like this, lined up in y-axis, which form illusion of 3d. Making a lot of static and animated sprites seems to be not optimal, IMHO
 

Tthecreator

Your Creator!
I see,
Well you could transfer it to a sprite, but then you would have to do some other skewing stuff which looks worse than how it looks now.
First thing you could do is make the yellow thing rotate.
Try figuring out how to rotate a non-sqaure image.
This could be done multiple ways trough to the scaling in draw_sprite_ext, or what i would recommend is using draw_sprite_pos.
Then use sin and cos to draw your sprite.
This does involve some math though. practically you want to rotate around a square...
Another option to try is to draw a textured primitive and apply the sin and cos to the texture coordinates.
Stuff is getting pretty complicated now. I recommend getting some good old pen and paper to make notes.
 

Tthecreator

Your Creator!
Sorry, this is because I reported to my thread in game design forum to move it at programming forum
O no, I was being stupid, I thought TDS was typing something, but thought he posted it double for some reason.
In reality he just removed the other duplicate post you, Dijkstra posted double.
 

Dijkstra

Member
I see,
Well you could transfer it to a sprite, but then you would have to do some other skewing stuff which looks worse than how it looks now.
First thing you could do is make the yellow thing rotate.
Try figuring out how to rotate a non-sqaure image.
This could be done multiple ways trough to the scaling in draw_sprite_ext, or what i would recommend is using draw_sprite_pos.
Then use sin and cos to draw your sprite.
This does involve some math though. practically you want to rotate around a square...
Another option to try is to draw a textured primitive and apply the sin and cos to the texture coordinates.
Stuff is getting pretty complicated now. I recommend getting some good old pen and paper to make notes.
Sound interesting, I'll try to figure out more info about this, thank you!
And how about using surfaces? Maybe drawing over my wheel single rotating sprite?
 

Tthecreator

Your Creator!
I would not recommend using surfaces, since a sprite is already a static texture.
You also want to animate the sprites, so you might be better of not using surfaces.

Yes, you could certainly put a rotating sprite over the object.
The problem is that the sprite isn't a perfect circle so you might get some trouble getting the animation right, but if maybe if you make your sprite in a square/pure circle form, and then stretch it down in the sprite editor, you should be fine.
 

Dijkstra

Member
At my double-posted thread:
In your script you have argument 1. Which is located at the second argument of draw_sprite_ext. Which is tied to the functions : subimg The subimg (frame) of the sprite to draw (image_index or -1 correlate to the current frame of animation in the object).

Changing the sub-image or the image rotation would be the easy solutions here.
That means, I need couple of sprites for single wheel?
My wheel now looks like that
GameMaker-Studio_2016-08-30_23-53-12.png
 
T

TDSrock

Guest
Seeing the gif I realize that this one is actually going to be a tad more difficult. The easiest thing I see would do just head into full 3D development instead of the simulated 3D.
I have no real experience with 3D in gamemaker, I did create my own rasterizer in C#, but that is using openGL.

If you want to hold on to the fake 3d effect then you'll probably have to add in more sprites to handle certain rotations then the current amount.
 

Tthecreator

Your Creator!
I'm slowly getting an idea of how your are handling things, I though the sprite with the yellow cross on it was a single sprite.
That makes things different.
Now surfaces might not be such a bad solution...
mmm... I see...
The trick is to make the yellow stripes rotate somehow...
What you should do is slap another sprite on top of your weels, and make that rotate.
 
Top