PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/visualizations/Goom/goom2k4-0/src/v3d.c

http://github.com/xbmc/xbmc
C | 15 lines | 14 code | 1 blank | 0 comment | 3 complexity | 74db9f6c7456b2dd9dd7cd8e46fe2a19 MD5 | raw file
 1#include "v3d.h"
 2
 3void v3d_to_v2d(v3d *v3, int nbvertex, int width, int height, float distance, v2d *v2) {
 4	int i;
 5	for (i=0;i<nbvertex;++i) {
 6		if (v3[i].z > 2) {
 7			int Xp, Yp;
 8			F2I((distance * v3[i].x / v3[i].z),Xp);
 9			F2I((distance * v3[i].y / v3[i].z),Yp);
10			v2[i].x = Xp + (width>>1);
11			v2[i].y = -Yp + (height>>1);
12		}
13		else v2[i].x=v2[i].y=-666;
14	}
15}