Re: Is this code correct?

2023-04-07 Thread z via Digitalmars-d-learn
On Saturday, 1 April 2023 at 15:32:27 UTC, Dennis wrote: On Friday, 31 March 2023 at 13:11:58 UTC, z wrote: I've tried to search before but was only able to find articles for 3D triangles, and documentation for OpenGL, which i don't use. The first function you posted takes a 3D triangle as

Re: Is this code correct?

2023-04-01 Thread Dennis via Digitalmars-d-learn
On Friday, 31 March 2023 at 13:11:58 UTC, z wrote: I've tried to search before but was only able to find articles for 3D triangles, and documentation for OpenGL, which i don't use. The first function you posted takes a 3D triangle as input, so I assumed you're working in 3D. What are you

Re: Is this code correct?

2023-03-31 Thread z via Digitalmars-d-learn
On Thursday, 30 March 2023 at 12:59:31 UTC, Dennis wrote: On Thursday, 30 March 2023 at 10:29:25 UTC, z wrote: Is this code correct or logically sound? You need to be exact on what 'correct' is. The comment above `triangleFacesCamera` says: Indicates wether a triangle faces an imaginary

Re: Is this code correct?

2023-03-30 Thread Dennis via Digitalmars-d-learn
On Thursday, 30 March 2023 at 10:29:25 UTC, z wrote: Is this code correct or logically sound? You need to be exact on what 'correct' is. The comment above `triangleFacesCamera` says: Indicates wether a triangle faces an imaginary view point. There's no view point / camera position

Is this code correct?

2023-03-30 Thread z via Digitalmars-d-learn
Is this code correct or logically sound? ```D import std; enum {side/depth/height and side/height x,//0 y,//1 z //2 } /** Indicates wether a triangle faces an imaginary view point. */ bool triangleFacesCamera(float[3] tA, float[3] tB, float[3] tC) { float r1, r2; r1 = atan2(tB[x] - tA[x