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!


Czar05

Member Since 20 Jun 2011
Offline Last Active Yesterday, 06:00 PM

Topics I've Started

Documentation for PSGL and GNMX

25 March 2015 - 12:09 AM

I was just wondering if the documentation for these Rendering APIs are made available to the public. I tried Google, but had no luck. Does one have to be a partner of Sony to acquire the documentation.

 

Also, If anybody has ever used these APIs, what were your impressions of them.


How to keep math/physics skills sharp?

23 January 2015 - 08:52 PM

I am curious on how you Math and physics gurus retain the amount of math you know. I have this horrible habit of learning a mathematical  or physics concept and then forgetting it months later. It never truly lasts long if I don't use it.

 

I have some math books lying around, and I usually try to learn from them whenever I can. I just don't want to waste my time reading and doing problems when I'm just going to forget it in a couple of weeks.

 

 

I just want to know what the secret is. Is it a matter of practicing math everyday? If yes, then how do you know which subject to practice on?

 

Would appreciate some input.


Advice on learning OpenGL

24 December 2014 - 01:52 PM

What are some tips or advice that you would give a beginner whose learning 3D computer graphics, especially with OpenGL. Is there anything you know now, that you wish somebody told when you first began learning OpenGL or  3D graphics programming in general. 

 

Would appreciate some advice, thanks.


Wouldn't this cause a memory leak?

14 December 2014 - 10:56 AM

This is probably a silly question, but I will ask anyway.

 

Wouldn't the following code cause a memory leak.

 
void LinkedList::addNode(int nValue)

{



    NodePtr newNode = new Node;

    newNode->next = nullptr;

    newNode->data = nValue;





    if(m_head != nullptr)

    {

        m_currentPtr = m_head;

    

        while(m_currentPtr->next != nullptr)

            m_currentPtr = m_currentPtr->next;

        

        m_currentPtr->next = newNode;

    }

    else

    {

        m_head = newNode;

    }



}

My problem is with the newly produced node

NodePtr * newNode = new Node

. The following code does not have a

delete newNode

anywhere in the program. I know there can't be a delete command in the function

addNode

, because that would be pointless, as it would delete the newly produced node. So I am left wondering, doesn't this cause a memory leak? Thanks in advance.

 

 

 


Trajectory of a projectile

09 November 2014 - 12:04 AM

I am having trouble getting the right parabolic trajectory for my projectile. So far, I have managed to figure out the initial velocity for the projectile. The projectile can launch, but I am not sure how I can get the proper parabolic trajectory. I know the only force that should be applied to the projectile is a vertical force (gravity or acceleration), but I can't seem to get it right.

m_Gravity = sf::Vector2f(0.0f, 9.81);
m_Max_Height = 180.0f;

I have tried using the following Newtonian Formulas http://en.wikipedia.org/wiki/Projectile_motion, but I keep mentally drawing blanks on the code implementation.

 

Below is what I have now

 

Input Function:

void Cannon::Input()
{
    if(m_barrel.getRotation() <= 105.0f)

    {

      if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))

      {

        m_barrel.rotate(1.0f);

        m_ball.rotate(1.0f);

        

      }

    }

    else if(m_barrel.getRotation() > 105.0)

    {

        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))

        {

            m_barrel.rotate(0.0f);

            m_ball.rotate(0.0);

        }

    }



    if(m_barrel.getRotation() > 1.0)

    {

        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))

        {

            m_barrel.rotate(-1.0f);

            m_ball.rotate(-1.0f);

        }

    }

    else if(m_barrel.getRotation() <= 1.0)

    {

        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))

        {

            m_barrel.rotate(0.0f);

            m_ball.rotate(0.0f);

        }

    }

    

    if(sf::Keyboard::isKeyPressed(sf::Keyboard::Space))

    {

        m_ball.move(m_initialVelocity);

        m_fired = true;

    }

}

Update Function:

 
void Cannon::Update()

{
    m_Newtime = m_clock.getElapsedTime();

    m_dt = m_Newtime - m_Oldtime;

    m_Oldtime = m_Newtime;



    float theta = ConvertToRadians();



    float Speedxi = 160.0f * sin(theta);

    float Speedyi = -160.0f * cos(theta);

    m_initialVelocity = sf::Vector2f(Speedxi, Speedyi);


}

 

Can somebody push me in the right direction on the code implementation. Thanks in advance.


PARTNERS