Draw sprites in '3D'?
Monkey Forums/Monkey Programming/Draw sprites in '3D'?
| ||
Im wondering if anyone has a system of rotating monkey images in 3D like 3D sprites? (with roll/pitch/yaw co-ordinates) I dont want to use MiniB3D unless absolutely necessary because I like to use HTML5 but my PC cant run webgl. So everytime I compile I would have wait extra time for flash or GLFW to compile. |
| ||
You could play with the matrix commands: SetMatrix PushMatrix PopMatrix |
| ||
That essentially requires texture mapped quads which can be done in software. You can get a ghetto 3d rotation effect by varying the x and y scale, eg. Scale sin(ticks),cos(ticks) which should make it look like it is rotating in 3d. One note about scale that's strange: if you set scale to 2,2 you have to set it back by setting it to .5,.5 because it is cumulative. I presume this is because Scale abstracts the matrix scaling commands so maybe popmatrix woukd fix it. I have toyed with the idea of setting up software normal mapping for lighting effects. I think that should be possible with up-rezzing from a low resolution and might look pretty good. At any rate I'm interested in this as well so let's discuss what we could do. I've had some ideas for simple 3d engines including a Comanche style fakevoxel terrain engine. |
| ||
something like this? http://nobuyuki.gpknow.com/lab/vectorball/ Once you have the points projected in 3d you can just use the DrawPoly overload to map a texture to a quad, if you want that sorta effect. |
| ||
Nobuyuki, would you be willing to share your code for the above example? |
| ||
Here's some Processing source for a vectorball effect. I agree that it would be nice to see Nobuyuki's. http://luis.net/projects/processing/vectorball/vectorball.pde |
| ||
Yes that would be great, I only need 'quads' just the ability to alter monkey images to different 3d positions and rotations (With parent child relationships) |
| ||
I think this works (just rotates points so far) |
| ||
Hi guys, sorry for not getting back to you right away. Here's the source code; it's old, ugly and you might not like it! Rotation is Euler, prepare for gimbal lock Edit: And here's the font ![]() |
| ||
thanks I managed to get a polygon to rotate: It seems to rotate every point around the co-ordinates 0,0,0 so I wonder how someone would change that? I tried the undocumented textured polygon command but it didnt work |
| ||
I ripped out the matrix stuff from minib3d: save it as Monkey/Modules/keef/matrix/matrix.monkey then here is the demo |