2D: Collision, Rotation, Scale, and more IN CANVAS
Posted: Fri Feb 15, 2013 8:47 pm
3D Engine for GE Canvas:
viewtopic.php?f=6&t=7259
I had this idea to make a really cool game and it had me thinking about Polygons: Rotation and Scaling. I never took geometry so I don't even know where to begin?!
So I thought.. "Look up Canvas functions!" And I ran into a wall. These functions while they have elements of what I am looking for all require a 3D model. I am not so interested in 3D. But I love this engine and would be grateful for anyone to tell me about how it works. I looked at the code myself and just can't grasp it. It's lacking commenting. I am a noob.
Really, what I would like to be able to have is a series of functions for Drawing, Rotating, and Scaling 2D polygons. Preferred just triangles. But I want to be able to choose the point of rotation. I have been searching google for anything about the sorts and come up with nothing but a algorithm for rotation that I don't understand.
A lead, a hand, a piece of anything. I am not expecting anyone to do work for me, just that I need these 3 functions and I have no possible understanding of how to create them on my own.
PSUEDOCODE:
viewtopic.php?f=6&t=7259
I had this idea to make a really cool game and it had me thinking about Polygons: Rotation and Scaling. I never took geometry so I don't even know where to begin?!
So I thought.. "Look up Canvas functions!" And I ran into a wall. These functions while they have elements of what I am looking for all require a 3D model. I am not so interested in 3D. But I love this engine and would be grateful for anyone to tell me about how it works. I looked at the code myself and just can't grasp it. It's lacking commenting. I am a noob.
Really, what I would like to be able to have is a series of functions for Drawing, Rotating, and Scaling 2D polygons. Preferred just triangles. But I want to be able to choose the point of rotation. I have been searching google for anything about the sorts and come up with nothing but a algorithm for rotation that I don't understand.
A lead, a hand, a piece of anything. I am not expecting anyone to do work for me, just that I need these 3 functions and I have no possible understanding of how to create them on my own.
PSUEDOCODE:
- Code: Select all
struct Triangle
{
p1;
p2;
p3;
}
Triangle tri1;
void Rotate_Triangle(Triangle* triangle, int pivotPoint)
{
//Rotation algorithm
}
void Scale_Triangle(Triangle* triangle, int scaleAmount)
{
//Scale algorithm
}
void Update_Canvas()
{
//draw functions
}