Hi !
The structure is simple, and anyone experienced could take a look to see if it could be further optimized. The UI should remain untouched. I’d like you to try it out. I'm also open to suggestions for improvements. Or just have fun with it!
I didn’t want to use OpenGL—I was hoping this could be solved with native tools. At first, I tried using a canvas, but even minimal drawing proved too slow. Then I tried the fast BitmapCreator, but it doesn't support rotation. After that, I looked into XUI2D, but I figured that even if I learned it, I would eventually run into limitations. So I ended up with OpenGL.
I'd like to highlight a simple idea. It would be great if it were possible to draw a triangle with the speed and simplicity of BitmapCreator. Not just lines or rectangles, but actual triangles. A triangle drawn in 2D space by specifying the three vertex coordinates—optionally also mapping it to texture coordinates from another bitmap. In fact, I’d take it a step further: even perspective drawing could be implemented, by allowing a Z-depth value for each of the triangle’s points. It’s mathematically simple. This way, you could quickly draw a 3D-positioned triangle onto a 2D surface, in software. With this added functionality, anyone could render in 3D onto a bitmap—no need to learn OpenGL for simple 3D rendering.
dim x as bitmapcreator
x.drawtriangle(x1,y1, x2,y2, x3,y3 ,COLOR,,, ) '2D drawing, colored triangle
x.drawtriangle3d(x1,y1,z1, x2,y2,z2, x3, y3, z3 ,COLOR,,,) '3D drawing, colored triangle
x.drawtriangle_frombitmap(x1,y1, x2,y2, x3,y3 ,BITMAP,,, tx1,ty1, tx2,ty2, tx3,ty3) '2D drawing using part of a bitmap
x.drawtriangle_frombitmap3d(x1,y1,z1, x2,y2,z2, x3, y3, z3 ,BITMAP,,, tx1,ty1, tx2,ty2, tx3,ty3) '3D drawing using part of a bitmap
This is just an idea. I think it would be very useful, and many would appreciate it. Everyone could build on it in their own way, without needing to learn OpenGL if only simple 3D drawing is needed. I'm not deeply knowledgeable in programming, but I’ll try to create a basic code module based on BitmapCreator (though it might not be the most elegant solution), so the concept can at least be tested.
https://drive.google.com/file/d/1kk...bH16YJ2uKYnandyIjfXv4nEC4/view?usp=drive_link
The structure is simple, and anyone experienced could take a look to see if it could be further optimized. The UI should remain untouched. I’d like you to try it out. I'm also open to suggestions for improvements. Or just have fun with it!
I didn’t want to use OpenGL—I was hoping this could be solved with native tools. At first, I tried using a canvas, but even minimal drawing proved too slow. Then I tried the fast BitmapCreator, but it doesn't support rotation. After that, I looked into XUI2D, but I figured that even if I learned it, I would eventually run into limitations. So I ended up with OpenGL.
I'd like to highlight a simple idea. It would be great if it were possible to draw a triangle with the speed and simplicity of BitmapCreator. Not just lines or rectangles, but actual triangles. A triangle drawn in 2D space by specifying the three vertex coordinates—optionally also mapping it to texture coordinates from another bitmap. In fact, I’d take it a step further: even perspective drawing could be implemented, by allowing a Z-depth value for each of the triangle’s points. It’s mathematically simple. This way, you could quickly draw a 3D-positioned triangle onto a 2D surface, in software. With this added functionality, anyone could render in 3D onto a bitmap—no need to learn OpenGL for simple 3D rendering.
dim x as bitmapcreator
x.drawtriangle(x1,y1, x2,y2, x3,y3 ,COLOR,,, ) '2D drawing, colored triangle
x.drawtriangle3d(x1,y1,z1, x2,y2,z2, x3, y3, z3 ,COLOR,,,) '3D drawing, colored triangle
x.drawtriangle_frombitmap(x1,y1, x2,y2, x3,y3 ,BITMAP,,, tx1,ty1, tx2,ty2, tx3,ty3) '2D drawing using part of a bitmap
x.drawtriangle_frombitmap3d(x1,y1,z1, x2,y2,z2, x3, y3, z3 ,BITMAP,,, tx1,ty1, tx2,ty2, tx3,ty3) '3D drawing using part of a bitmap
This is just an idea. I think it would be very useful, and many would appreciate it. Everyone could build on it in their own way, without needing to learn OpenGL if only simple 3D drawing is needed. I'm not deeply knowledgeable in programming, but I’ll try to create a basic code module based on BitmapCreator (though it might not be the most elegant solution), so the concept can at least be tested.
https://drive.google.com/file/d/1kk...bH16YJ2uKYnandyIjfXv4nEC4/view?usp=drive_link