⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pt2plane.c

📁 图形处理算法合集3:包括图形处理、帧缓存技术、渲染、矩阵运算、建模方法
💻 C
字号:
/******************************************************************************                   Signed Distance from Point to Plane                       Author: Priamos Georgiades******************************************************************************/#include<stdio.h>typedef struct vect3str {    float x, y, z;    } vect3;typedef struct vect4str {    float x, y, z, w;    } vect4;#define Vect3Dot(v1, v2) ((v1).x * (v2).x + (v1).y * (v2).y + (v1).z * (v2).z)/*Compute the distance from a point to a plane. The plane ispleq->x * X + pleq->y * Y + pleq->z * Z + pleq->w = 0.The distance is positive if on same side as the normal, otherwise negative.Assume the plane normal to be of unit length.*/float Pt2Plane(vect3 *pt, vect4 *pleq){float dist;dist = Vect3Dot(*pleq, *pt) + pleq->w;return(dist);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -