Some years ago, on the old forum that went kabooom, I posted an extended version of the n6 Simple3D library. The posted version let you create and display some primitive 3d shapes (spheres, cubes, cylinders etc) and even load models in the off file format.
Does anyone have a copy of the library I posted? Lots of code there that I don't want to rewrite for my new experiments ...
I will be "off the air" from Saturday morning until Monday afternoon. Off on our annual camping break... yah... (not a fan of camping lol) Forecast temperatures for Saturday 39C, Sunday and Monday 38C... The "big three" camping issues... Flies; mosquitoes and Sunburn... I suppose it would be worse if it was hot...
This is not a full game, just a player that you can control and some asteroids that fly around. But there are lots of transformed image drawing going on, including the spinning and zooming background image. I'm curious about the fps on your machines? I have a solid 250fps here, but maybe this craptop is a laptop after all.
I am a fan of Naalaa, you know it
I subcribe and receive email notification of new replies from the Naalaa's forum.
I notice that it is still N6 logo click the image to zoom in
Perhaps ... it is time to change to new N7 logo ...
logo_N7.png (Size: 8.96 KB / Downloads: 24)
click the image to zoom in
I haven't experimented with (or even tested, to be honest) the new commands much yet, and the included examples are minimal. But I will provide game examples soon.
Release notes
2024-03-05
'this.' can now be written as just '.'
Added the commands 'draw image xform' and 'draw poly image'. You can find two small examples under examples/help: draw_image_xform.n7 and draw_poly_image.n7
'draw image xform' is for drawing transformed (scaled and rotated) images. 'draw poly image' is for drawing texture mapped polygons.
I cannot recall if I have raised this question before... forgive if I have... What is involved in creating a simple physics engine / library? Say something like Box2D or Box2D-lite? The big question(s)... Can N7 do it... and how?
I wrote a quick prototype of drawing images with arbitrary rotation and scaling in n7. The code may look a bit too complicated for just drawing a transformed image. But when I add this stuff to the core (implement it in C and add new commands to n7), I will also let you draw textured polygons with any number of points. Here I just draw a textured rectangle, four points.
It's slow, but it's gonna get a lot faster, of course.
I'm already thinking about adding support for z coordinates and perspective correct interpolation (for polygons). Would be fun to allow some 3d rendering as in naalaa 5.
a = 0
while not keydown(KEY_ESCAPE, true)
a = (a + 1)%360
set color 0, 0, 0
cls
set color 255, 255, 255, 0
' DrawImageTransformed(image, x, y, scale_x, scaleY, angle, pivot_x, pivot_y)
' draw scaled and centered (= pivot at center of image).
DrawImageTransformed(img, 120, 240, 2, 2, 0, width(img)/2, height(img)/2)
' draw rotated and centered
DrawImageTransformed(img, 320, 240, 1, 1, rad(a), width(img)/2, height(img)/2)
' draw rotated and scaled but put pivot at top left corner of image.
DrawImageTransformed(img, 520, 240, 4, 4, rad(a), 0, 0)
redraw
fwait 60
wend
Here's a small library that could be used for enemy movement in space shootemups (that's the only use I can think of), example included.
The truth is that I had made quite a nice shootemup that used the library. But when I was going to zip it I wanted to delete all built files (exe, n7a, n7b ...). Instead of deleting the exe file, I deleted the source code
Edit I updated the zip with a new version of the library and some more examples of how it can be used in a shootemup.