? How to make a 3D Texture? (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

How to make a 3D Texture?

  • #1 ✎ 24 DevinF06 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Is there a easy way to skew a image (or whatever works) to make a 3D texture? Posted
  • #2 ✎ 550 IAmRalsei Forum Leader Hidden Achievements First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength use sim.3d (higher performance) or poly3d (has model creator) and color the tris to make a texture lol Posted Edited by IAmRalsei
  • #3 ✎ 24 DevinF06 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies I mean a texture face where the image is stretched over a object And also I think that many tris (and generating them) will slow down Posted Edited by DevinF06
  • #4 ✎ 1614 12Me21 Head Admin Second Year My account is over 2 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself
    Is there a easy way to skew a image (or whatever works) to make a 3D texture?
    There isn't.
    Posted
  • #5 ✎ 132 DFrost Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength There is P3D by Bugtaro that you can use, but it is a pain to use. Posted
  • #6 ✎ 83 seggiepants 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. Posted
  • #7 ✎ 1614 12Me21 Head Admin Second Year My account is over 2 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself 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: [url=https://www.youtube.com/watch?v=3y6gQRDDBLg]https://www.youtube.com/watch?v=3y6gQRDDBLg[/url] This took a few minutes to write Posted Edited by 12Me21
  • #8 ✎ 83 seggiepants 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. Posted
  • #9 ✎ 24 DevinF06 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies There could be a way, but it would need: - Lots of memory - And a long time What I'm saying is: Pre-rendering Posted
  • #10 ✎ 274 Shelly
    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.
    Well if you're doing texels you could just do quads instead of tris, in order to be more efficient. It would require about 33% less processing, since you wouldn't be doing math for some vertices twice.
    Posted