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
494 VII 3D Engine Design
float3 gv [3] , v [3];
// Compute grid space positions from worldspace positions ;
// g SceneLBFbox contains the left , bottom, and front points
// of worldspace bounding box of the grid
gv [0] = ( input [0].f3WorldSpacePos g_SceneLBFbox . xyz )/
f3CellSize ;
gv [1] = ( input [1].f3WorldSpacePos g_SceneLBFbox . xyz )/
f3CellSize ;
gv [2] = ( input [2].f3WorldSpacePos g_SceneLBFbox . xyz )/
f3CellSize ;
// Compute triangle edges
float3 d0 = gv [1] gv [0];
float3 d1 = gv [2] gv [0];
// Compute triangle normal
float3 N = normalize( cross ( d0 , d1 ));
float3 C =( 1.0f /3.0f ) ( gv [0] + gv [1] + gv [2] );
// Move eye posi
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