Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 05 May 2013
Offline Last Active Jun 14 2015 05:14 PM

Topics I've Started

Finding covered tiles of the brush

29 November 2014 - 03:44 PM

I need to calculate terrain brush covers how much tiles.And i need to find which tiles has been selected.I use hexagonal tiles.When brush size changed,covered area size changes.

I need an algorithm for this problem.

I looked to this site : http://www.redblobgames.com/grids/hexagons/ But i couldn't understand.

Thanks in advance.


for example:

Attached File  pic1.jpg   72.66KB   0 downloads

my editor :

Attached File  pic3.jpg   76.45KB   0 downloads

Character Rotation While Moving

14 May 2014 - 09:25 AM

Hi.I use SFML with Box2D.I can't rotate the character sprite like GTA 2.My codes:



        body->ApplyLinearImpulse(b2Vec2(0,-10 * UNRATIO),body->GetWorldCenter(),true);
    else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)){
        body->ApplyLinearImpulse(b2Vec2(0,10* UNRATIO),body->GetWorldCenter(),true);

        body->ApplyLinearImpulse(b2Vec2(-5* UNRATIO,0),body->GetWorldCenter(),true);

    else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)){
        body->ApplyLinearImpulse(b2Vec2(5* UNRATIO,0),body->GetWorldCenter(),true);


    b2Transform trans = body->GetTransform();
    animatedSprite.setOrigin(width / 2, height / 2);
    angle = trans.q.GetAngle();
    animatedSprite.setRotation(RADTODEG(angle) );

    animatedSprite.setPosition(body->GetWorldCenter().x * RATIO,body->GetWorldCenter().y * RATIO);

    sf::Time frameTime = frameClock.restart();
         // update AnimatedSprite


I drew the problem.Can you help me?Thanks.

Terrain or 3d model with physics?

03 March 2014 - 05:37 AM

Hi.I want to know that how game developers create a 3d world?For example Skyim.Are they using terrain algorithms and create a terrain?Or they create a 3d model with 3ds Max/Blender then add physics?I am waiting for your reply smile.png


Texture problem on a 3d model

24 December 2013 - 01:23 PM

This is very strange error.I have an ms3d(milkshape 3d) model.I am rendering it but it doesnt appear correctly.It is covered by repeated white textures.
I load textures with sfml.My texture loading code:

bool CImage::Load(char * szFilename, bool bMipMap)
	m_bMipMap = bMipMap;
	m_szFilename = szFilename;

    sf::Image img_data;

    m_uiWidth = img_data.getSize().x;
	m_uiHeight = img_data.getSize().y;

    m_uiImage = 0;

	glGenTextures(1, &m_uiImage);
	glBindTexture(GL_TEXTURE_2D, m_uiImage);

		gluBuild2DMipmaps(GL_TEXTURE_2D, 3, m_uiWidth, m_uiHeight, GL_RGB, GL_UNSIGNED_BYTE,  img_data.getPixelsPtr());
		glTexImage2D(GL_TEXTURE_2D, 0, 3, m_uiWidth, m_uiHeight, 0, GL_RGB, GL_UNSIGNED_BYTE,  img_data.getPixelsPtr());

	return true;


Any help will be appreciated.

FPS camera - objects problem

18 July 2013 - 06:19 PM

I develop a fps game.I attached gun to camera.But i can't put gun to front of objects.In first picture everything is normal.But in the second picture gun is rendering at back.I can scale objects.If i scale objects , i need to raise zfar value.Will the game use more memory if i do that?What can i do otherwise?