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

[CS:S]The calculation of the normals to the surfaces


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tonline_kms65
Member
Join Date: Aug 2016
Location: Ru. Komsomol-on-Amur
Old 07-17-2017 , 03:30   [CS:S]The calculation of the normals to the surfaces
Reply With Quote #1

TR_GetPlaneNormal
This function returns the values of what type? Cos, Radians, or something else? For example, a value of 1.000000 is perpendicular (90 degrees)

In the video, the blue ray shows the vector of measurement values output at the bottom of the screen in the center.

Last edited by tonline_kms65; 07-17-2017 at 07:47.
tonline_kms65 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-17-2017 , 05:51   Re: [CS:S]The calculation of the normals to the surfaces
Reply With Quote #2

Normals are unit vectors.
klippy is offline
tonline_kms65
Member
Join Date: Aug 2016
Location: Ru. Komsomol-on-Amur
Old 07-17-2017 , 06:49   Re: [CS:S]The calculation of the normals to the surfaces
Reply With Quote #3

Quote:
Originally Posted by KliPPy View Post
Normals are unit vectors.
Normalized? ie = 1?

I need to get the angle of the triangle surface

Code:

  TR_TraceRayFilter(f_pos, Float:{90.0, 0.0, 0.0}, MASK_SOLID, RayType_Infinite, _TraceFilter, ent);
  if (TR_DidHit(INVALID_HANDLE)){
  TR_GetEndPosition(f_ground);  
  TR_GetPlaneNormal(INVALID_HANDLE, f_norm);    //                                    
  GetVectorAngles(f_norm, f_angles);         //Here convert the vector to an angle.
GetVectorAngles Function

Returns angles from a vector.

void GetVectorAngles(const float vec[3], float angle[3])
Parameters

const float[3] vec
Vector.

float[3] angle
Angle buffer.


This angle is radians? Or the cosine of the angle? Or something else?

Last edited by tonline_kms65; 07-17-2017 at 07:06.
tonline_kms65 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-17-2017 , 07:20   Re: [CS:S]The calculation of the normals to the surfaces
Reply With Quote #4

I don't code at all for Source games, but my general knowledge tells me it's probably an axis-angle in degrees. Print out the result and see for yourself.

Last edited by klippy; 07-17-2017 at 07:20.
klippy 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 04:22.


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