Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

i have a 1st person camera that collides with walls, i also have a small sphere in front of my camera denoted by the camera position plus the distance ahead. I cannot get the postion of the sphere but i have the position of my camera. e.g. enter image description here

i need to find the position of the point or at the very least find away of calculating the position using the camera positions. code:

    static Float P_z = 0;
    P_z = -15;
    PushMatrix();
    LoadMatrix(&Inv);
    Material(SCEGU_AMBIENT, 0x00000066); 
    TranslateXYZ(0,0,P_z);
    ScaleXYZ(0.1f,0.1f,0.1f);
    pointer.Render();
    PopMatrix();

where Inv is the camera positions (Inv.w.x,Inv.w.z), pointer is the sphere.

share|improve this question
The question is unclear. Are you asking what's wrong with your code? – pydave Dec 1 '12 at 16:47

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.