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
Line Drawing
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Line Drawing
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 https://github.com/switchbrew/switch-ex ... 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?
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?
Who is online
Users browsing this forum: No registered users and 0 guests