Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Mar 2011
Offline Last Active Apr 24 2014 07:35 PM

Posts I've Made

In Topic: math problems

24 April 2014 - 07:34 PM



Or just base your math on the simple idea that your map is a rectangular grid rotated by 45° and 60°, transform your mouse coordinates accordingly and you should get the same result


Wouldn't this actually be more complicated? I would need to create regular greed and rotate it 45 degrees, and than additionally transform mouse coordinates. Seems interesting but I am not quite sure how I would handle data in this case. Would I save out all data as if it was square greed and transform it on run-time?

In Topic: math problems

23 April 2014 - 02:41 PM

This is all completely 2D stuff. What I did is, I created grid using one sprite and simply placing it on calculated X and Y coordinates to form a grid.


I am looking into point in polygon stuff, but I am not sure how to do this yet. This is what I am testing with

// triangle to test against
sf::ConvexShape hex;
hex.setPoint(0, sf::Vector2f(0, 0));
hex.setPoint(1, sf::Vector2f(96, 0));
hex.setPoint(2, sf::Vector2f(0, 48));

// check coordinates if inside the triangle
if(Mouse.x >= hex.getPoint(0).x && Mouse.y >= hex.getPoint(0).y)
  if(Mouse.x <= hex.getPoint(1).x && Mouse.y >= hex.getPoint(1).y)
    if(Mouse.x >= hex.getPoint(2).x && Mouse.y <= hex.getPoint(2).y)
	diamond.setPosition(0, 0); // this is tile marker - it will highlight the tile mouse pointer hovers over

Something is off since I am still in rectangle calculation and not triangle. Am I on the right track?


EDIT: I found this - http://www.geeksforgeeks.org/how-to-check-if-a-given-point-lies-inside-a-polygon/ - looks close to the first reply, and this does answer my question. Thanks for help everyone.

In Topic: compile windows code on unix

23 December 2013 - 01:07 PM



Unless I understood proanim's question wrong, he's not looking to compile a windows program that works on unix, he's looking to build windows executables with a unix machine as build server.

Is that correct, proanim? 


The idea was to compile program remotely from unix build server, which will run on windows, but later be ported to linux and mac. And, program is supposed to have both directx and opengl included not just one (for windows version).

In Topic: Best living engineer?

10 December 2013 - 06:26 PM




as far as John Carmack goes, he's a regular hacker, he made a lot of money off some fairly uninspiring games because he came in early and ID has been seriously out of touch for quite some time


Pro tip: you need to do your research before you say anything. If there was voting enabled in lounge posts you would be probably be down voted to oblivion. I don't mean to start flame war but just saying.


Both guys are geniuses in their departments, possibly irreplaceable.

In Topic: seamless tiling of UV's

24 October 2013 - 01:22 PM

Ok thanks, it took me awhile to find out that my math was slightly off, since i also used what is practically the same function.