Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Inside triangles in space

Author
Message
Programmer X
17
Years of Service
User Offline
Joined: 14th Nov 2007
Location:
Posted: 21st Jan 2014 22:21
Trying to pull off a inside 3d Triangle algorithm using spherical coordinates do you see why it prints nothing?(The following is a part of it in C++ the program is attached)

int pnpoly(int nvert, float *vertx, float *verty, float testx, float testy)
{
int i, j, c = 0;
for (i = 0, j = nvert-1; i < nvert; j = i++) {
if ( ((verty[i]>testy) != (verty[j]>testy)) &&
(testx < (vertx[j]-vertx[i]) * (testy-verty[i]) / (verty[j]-verty[i]) + vertx[i]) )
c = !c;
}
return c;
}

XXX

Attachments

Login to view attachments
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Jan 2014 06:10
Maybe post this in the GDK forum?

What do you mean by an inside triangle?

Login to post a reply

Server time is: 2025-05-15 17:30:00
Your offset time is: 2025-05-15 17:30:00