### Line Drawing

Posted:

**Sat Mar 16, 2019 9:29 pm**I'm trying to draw a rotating wire frame cube.

My first problem was drawing a line. The only way I could achieve this was by using Bresenham. This went ok. (Is there a line drawing routine in libnx for the Switch??)

The next problem was actually rotating the wire frame cube.

pp=cos(phi) is ok BUT pp=cos(phi+1) throws up the following error - unknown cos. When ever I try to increment the angle (degrees or radians) it fails to recognise the cos or sin commands. But cos(45) is ok but not cos(44+1). Even phi+1 followed by cos(phi) gives a similar error.

The actual wire frame cube is a standard C program and the rewritten code runs on everthing else I've tried - including LUA, qb45 etc - and it rotates as it should by incrementing phi and theta.

I've included all the relevant libraries etc. in my C source

Why no line drawing routine (or have I missed it?) and why does cos(phi+1) give an error.

It's driving me nuts. Any help would be appreciated.

Thanks, John

My first problem was drawing a line. The only way I could achieve this was by using Bresenham. This went ok. (Is there a line drawing routine in libnx for the Switch??)

The next problem was actually rotating the wire frame cube.

pp=cos(phi) is ok BUT pp=cos(phi+1) throws up the following error - unknown cos. When ever I try to increment the angle (degrees or radians) it fails to recognise the cos or sin commands. But cos(45) is ok but not cos(44+1). Even phi+1 followed by cos(phi) gives a similar error.

The actual wire frame cube is a standard C program and the rewritten code runs on everthing else I've tried - including LUA, qb45 etc - and it rotates as it should by incrementing phi and theta.

I've included all the relevant libraries etc. in my C source

Why no line drawing routine (or have I missed it?) and why does cos(phi+1) give an error.

It's driving me nuts. Any help would be appreciated.

Thanks, John