Skip to Content
GPU Pro 6
book

GPU Pro 6

by Wolfgang Engel
July 2015
Intermediate to advanced
586 pages
17h 21m
English
A K Peters/CRC Press
Content preview from GPU Pro 6
440 VI Compute
1 // Plane equation from three points , simplified
2 // for the case where the f i rst point is the origin .
3 // N is normalized so that the plane equation can
4 // be used to compute signed distance .
5 float4 CreatePlaneEquation ( float3 Q , float3 R)
6 {
7 // N = normalize(cross(QP,RP) ) ,
8 // except we know P is the origin
9 float3 N = normalize( cross ( Q , R ));
10 // D = (N dot P) , except we know P is the origin
11 return float4( N ,0) ;
12 }
13
14 // Convert a point from postprojection space into view space
15 float3 ConvertProjToView ( float4 p)
16 {
17 p = mul ( p , g_mProjectionInv );
18 return ( p / p . w ).xyz ;
19 }
20
21 void ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

GPU Pro 4

GPU Pro 4

Wolfgang Engel
GPU Pro 5

GPU Pro 5

Wolfgang Engel
GPU Pro 7

GPU Pro 7

Wolfgang Engel
GPU PRO 3

GPU PRO 3

Wolfgang Engel

Publisher Resources

ISBN: 9781482264623