Hello everyone ! It’s my first post and I’m glad to be new member of the community
I’m attempting to write a code that allows me to create a 3D image out of a 2D image. I’ve tried this code (see bellow) but it seems not to work (for I’m sure a very obvious reason I can’t find for 4 whole days now… ).
My idea is to create a box() for each pixel of my image with its z parameter linked to the brightness of each pixel of my image (the x and the y stays the same as the x and the z of each pixel).
But running the code bellow only create a sort of big white rectanglish cube…
If anyone can get me out of the infinite loop I’ve put myself in for the past 4 days, I’ll be more than grateful.
Close. The 3D box() function doesn’t take position and a size. It takes a width, height, a depth. To position the boxes you need to make better use of the 3D translation functions. Sample code:
Thank you v much for ur response. It helps a lot ! I still have to figure out how to make each box “taller” or “deeper” according to the brightness value, but hey, need to learn fishing instead of getting fishes for free
Right, well, the parameters to the box() function are the size of each box. Set x and y to 1, and vary the z size based on the brightness. You also want to adjust the position because boxes are drawn from their centers:
This isn’t a fish for you. This is a picture of me wearing my fisherman hat and holding my fishing rod and eating some fish. Study the elements that this snapshot presents and understand what they are for and how you can use them.