How to make a 3D Texture?
Root / Programming Questions / [.]
DevinF06Created:
It sounds like you want to texture map an image onto a polygon. The way you phrased it almost sounded like you wanted voxels or mip mapping.
While the 3DS certainly has the functionality in hardware, SmileBasic does not give you any way to access it directly. You could try texture mapping with math manually, but you would not end up with something that would run at multiple frames per second. Even just plotting out the pixels would be slow. I tried plotting out a full screen of pixels with GPSET and on my "New" 3DS, I got 2.2 frames/second with significant screen tearing. If I switched to using GLOAD to load everything from an array, it didn't tear, but I still only got 2.4 frames/second. Even just drawing triangles with GTRI isn't all that fast. I only got up to about 512 random triangles before my frame rate dropped down to about 15 frames/second.
You were correct to say that emulating textures mapping with triangles would be too slow. Each textel would need to be two triangles. For an cube with an 8x8 texture on each face, that is 6 sides * 8 textels wide * 8 textels tall * 2 triangles = 768 triangles. Of course with back face removal that is really only about 384. Still one cube with three faces showing with a 8x8 texture drops you down to low frames per second.
Now for a positive note, the upcoming version of Fuze 4 Switch does seem to have 3D capability, if you look at their Youtube videos https://www.youtube.com/watch?v=p47wUum4Fhw they have a demo that appears to be using texture mapping while modifying the texture on the fly. Of course assuming it doesn't get delayed once more you still have to wait until April, have a Switch and purchase it for about $40 USD. Hopefully SmileBasic for Switch will follow suit, but I wouldn't count on it.
That's not true 3D, they're just using simple transformations.
Basically they just the source image and stretch and skew it, something that you can easily do in SB with strips of sprites.
(Each sprite would be 1 pixel wide but I made them larger in this image so it's easier to see)
Basically you just stretch the sprites, and move the strips up and down, to simulate a 3D effect.
EDIT:
https://www.youtube.com/watch?v=3y6gQRDDBLg
This took a few minutes to write
I've been hoodwinked! I could have sworn they said 3D games on their website, so I assumed that was what was going on.
Here it is, you can find the 3D mention at: https://www.fuze.co.uk/nintendo-switch.html
FUZE4 Nintendo Switch
Easy to learn text based programming language
No coding experience required
Create your own apps and fast 2D / 3D games
Access Joycon sensors and controls directly in your programs
Use the Dock to show your games on your TV to share with friends and family
Programmable synthesizer & Speech engine
Use the included game graphics & audio or create your own
Extra content packs will be available to download
Use a USB keyboard, the FUZE touch keyboard or the Joycons to enter your code
Learn to code
So I think there will be 3D support. In fact the comments links to these pictures.
So, yeah, looks like the YouTube link is bad but I still think there will be some sort of 3D support.