Raised This Month: $51 Target: $400
 12% 

[REQ] Angle between two view angles -> PIC


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 03-29-2016 , 12:58   [REQ] Angle between two view angles -> PIC
Reply With Quote #1

Hello,

I anyone knows ?



Thanks in advance..

Last edited by ESK0; 03-29-2016 at 13:01.
ESK0 is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 03-29-2016 , 17:49   Re: [REQ] Angle between two view angles -> PIC
Reply With Quote #2


PHP Code:
#define min(%1,%2) (%1 < %2 ? %1 : %2)
#define max(%1,%2) (%1 > %2 ? %1 : %2)

float MyAngle(const float angAbsRotation1[3], const float angAbsRotation2[3])
{
    
float ang max(angAbsRotation1[1], angAbsRotation2[1]) - min(angAbsRotation1[1], angAbsRotation2[1])

    if (
ang 180.0)
        
ang 360.0 ang;

    return 
ang// degrees

In ur case, u can do next:
PHP Code:
if (MyAngle() < 90.0)
    
YourAngle MyAngle() + 180.0;
else
    
// players are looking in different directions 
Attached Thumbnails
Click image for larger version

Name:	??????????.png
Views:	217
Size:	8.9 KB
ID:	153240  
Kailo is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 03-30-2016 , 08:19   Re: [REQ] Angle between two view angles -> PIC
Reply With Quote #3

Quote:
Originally Posted by Kailo View Post

PHP Code:
#define min(%1,%2) (%1 < %2 ? %1 : %2)
#define max(%1,%2) (%1 > %2 ? %1 : %2)

float MyAngle(const float angAbsRotation1[3], const float angAbsRotation2[3])
{
    
float ang max(angAbsRotation1[1], angAbsRotation2[1]) - min(angAbsRotation1[1], angAbsRotation2[1])

    if (
ang 180.0)
        
ang 360.0 ang;

    return 
ang// degrees

In ur case, u can do next:
PHP Code:
if (MyAngle() < 90.0)
    
YourAngle MyAngle() + 180.0;
else
    
// players are looking in different directions 
Thanks, i made some minor changes and works great!
ESK0 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode