Camera Turn

Posted on 2005-05-15
Last Modified: 2010-04-07
Hi Aqua,

In the earlier Camera Method you provided me , does the turn method just turn from the same point.I think it does not , it just take a round turrn.But i wanted it to take a turn from the same point.Can you help me on this.

Because when i take a turn near the wall.I should be able to see the wall but instead i am not able to.I amd see the other side of the wall.

I tried changing the looking radius but it does not change anything.

Question by:srihari1986
    LVL 10

    Expert Comment

    by:Andrew Beers
    *blinks*  The turn method turns about a point with a unit circle of diameter 1 unit.  Changing the look radius will not keep your user from looking "through" your wall... it only affects the jumps of angles.. well... sort of...  

    The way you can keep a user from looking through the wall is use a farther collision line further from the wall...  If you still have a problem looking through the wall perhaps you have some toying to do with your normals or lighting..  The camera class allows you to move and turn as if you were a real person moving about a scenery... And unless you keep the player from walking through the walls you will always be able to pass through a wall... *shrugs*  ...Perhaps I'm missing your question but... *shrugs*  ...The class allows you to rotate about a central point by pressing 4 and 6... Look up and down by pressing 8 and 5 and strafe while using 7 and 9.   If you want to walk forward and backward using 1 and 0.

    If I'm missing your question please point me a bit in more of a specified direction.


    Author Comment

    Hi ,

    My question is ...If i want the user to turn, i dont want him to do a turn by a circle.I just want him to turn from the point he is standing.

    SOmething like , i dont want the camera to move from the place when i turn , i just need it to turn backwards when i press 4 or 6...

    LVL 10

    Accepted Solution

    *blinks*  You want the camera to rotate just so you are looking in the reverse direction from your current direction?  The current idea of the turn rotates the looking point about a circle while the center point stays constant...  Aka.  the camera does not move...

    I guess what you are asking is that you just want the camera to look 180 degrees from the current looking point?  I see no real point in this but is is VERY simple to change... just make the rotate difference PI or 180 degrees...  Am I hitting at the real question now or am I still missing the boat?  The camera does pivot about a stationary point if that is what you are refering to...  to do a turn without using a circle is impossible as that is how the glLookAt() function works.  You have the camera position and the camera look at position... this is the way it works...  and is the way the camera works for almost every graphics language out there dealing with 3D space.

    I hope I helped out...  I'll keep an eye out.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
    Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now