• entries
    743
  • comments
    1924
  • views
    578701

PolyMap

Sign in to follow this  
Aardvajk

142 views

Started a new and improved polygon map editor:



It is based on creating everything out of triangles, which makes texturing and rendering easier and also prevents you creating non-convex polygons which would mess up my collision detection in the game.

It is, however, smart enough to realise when you click a counter-clockwise triangle and reverse the order appropriately.

Rather than have a messy and complex GUI, it has a system whereby when you press Tab, a text entry line appears at the bottom of the screen and you type in commands, like "grid 64" or "wireframe off" and so on.

Later, it will be possible to map keys to commands. Probably.
Sign in to follow this  


6 Comments


Recommended Comments

Is this project going to have anything to do with giant space fish - or are you just getting my hopes up with all these "naked" fish?

Share this comment


Link to comment
Giant space fish aren't planned for the game. It just seems that for some reason, when I draw things made of polygons, I draw fish by default.

I'm sure that psychoanalysts would have a field day.

Share this comment


Link to comment
What method are you using to determine whether the winding order of a given triangle is CW or CCW? I haven't given automatic detection any thought for my editor, but it would certainly be a boon for non-me users. [grin]

Share this comment


Link to comment
Quote:
Original post by EasilyConfused
Giant space fish aren't planned for the game. It just seems that for some reason, when I draw things made of polygons, I draw fish by default.

I'm sure that psychoanalysts would have a field day.

Awwwwwww!

Share this comment


Link to comment
Quote:
Original post by HopeDagger
What method are you using to determine whether the winding order of a given triangle is CW or CCW? I haven't given automatic detection any thought for my editor, but it would certainly be a boon for non-me users. [grin]


Given a std::vector of three G2D::Vectors (confusing, huh? [smile]):


void NormaliseTriangle(std::vector<G2D::Vector> &P)
{
if(((P[1].X-P[0].X))*((P[2].Y-P[0].Y))<((P[2].X-P[0].X))*((P[1].Y-P[0].Y)))
{
G2D::Vector Temp=P[1]; P[1]=P[2]; P[2]=Temp;
}
}

Share this comment


Link to comment
What's the concept behind it, though? Does it have a name? Or did you just start applying arithmetic operations to the vertices until it worked? :P

Share this comment


Link to comment

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