Line Drawing

Post Reply
Posts: 1
Joined: Sat Mar 16, 2019 9:03 pm

Line Drawing

Post by johnfarrant » 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

Site Admin
Posts: 1478
Joined: Tue Aug 09, 2005 3:21 am
Location: UK

Re: Line Drawing

Post by WinterMute » Wed May 08, 2019 8:08 pm

There are no line drawing functions in libnx, no. The switch has a fairly advanced GPU which is more than capable of drawing wireframe cubes by itself - see ... ics/opengl which should be in your installation under /opt/devkitpro/examples/switch/.

The other problems you're reporting don't seem to make much sense. Can we see your source code and the actual verbatim error output if possible?
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest