LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Daslee on July 30, 2013, 19:31:04

Title: Third person camera walking with ray picking
Post by: Daslee on July 30, 2013, 19:31:04
Hello. I'm trying to do walking with ray picking in third person camera game. Now it works good, but only when yaw rotation is near 0. Here is video about my problem: http://www.youtube.com/watch?v=bwZ02M_VFW0 (http://www.youtube.com/watch?v=bwZ02M_VFW0)

And now I don't know where could be the problem, so I don't know which codes should I post here. I can post here ray-plane intersection code or how I'm getting ray direction or how I'm doing whole walking(getting ray direction, checking for intersection with planes and then going to intersected point).
Title: Re: Third person camera walking with ray picking
Post by: quew8 on July 31, 2013, 10:37:46
Sounds like a problem in how you are calculating the ray, probably best to see that. Although you could post the whole lot in pastebin and link that here. It would probably be the easiest.
Title: Re: Third person camera walking with ray picking
Post by: Daslee on July 31, 2013, 14:50:15
This is how I'm doing whole walking: http://pastebin.com/5uXuRJVT (http://pastebin.com/5uXuRJVT) ray calculation is between glPushMatrix() and glPopMatrix(). And getLookAtDirection method (its actually ray direction): http://pastebin.com/DgeWABA7 (http://pastebin.com/DgeWABA7).