Page 1 of 2

Drawing 3D prisms/polygons (by pyro)

PostPosted: Wed Apr 09, 2008 3:30 am
by pyrometal
Hey guys! I beleive I am the first GE user to have made a trimetric polygon/prism rendering system with GE! Once again I come to you with an other 3D system, in order to satisfy the 3D craze. All prisms are generated in "wireframe" and all commands must be typed in manually in the text box and then press ENTER key to activate/use them. This demo starts with a prebuilt pyramid revolving in space.

Here are all the commands that you can type in the prompt:
- "clear", clears all data.

- "c_red", wireframe color red.
- "c_green", wireframe color green.
- "c_blue", wireframe color blue.
- "c_yellow", wireframe color yellow.
- "c_cyan", wireframe color cyan.
- "c_magenta", wireframe color magenta.

-"axis_" + ("x","y", or "z") + ("+" or "-"), rotate object around the x,y, or z axes in either direction (+/-)
-"axis_stop" + (optionally "_x", "_y", or "_z"), stops all rotating of object (unless x, y, or z is specified)

-"demo_" + ("pyramid" or "cube" or "plane" or "octahedron"), builds a demo prism to rotate.


This demo was meant to demonstrate the code I developped, and hopefully help some people accomplis cool 3D effects if needed. I know the control prompt design is kinda sketchy and odd to use for most people, but I really didn't feel like designing a GUI for this project. Please do take a look at my codes, see how its made. Now that this is done, I'll try to think about another topic to demo about. Catch ya later guys!

screenshoot.PNG
octahedron revolved at some random angle

Project Prism.zip
The GED file
(8.9 KiB) Downloaded 344 times

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Wed Apr 09, 2008 3:34 am
by pyrometal
ADD: You may want to make the demo windowed instead of fullscreen in or to look at the functions for the command prompt

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Wed Apr 09, 2008 2:31 pm
by kirby
Cooooool. Yeah awesome. (TRUEEEEEE) Wow this take you lot of time to do? Another 1+ for you!!!!! :lol:

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Wed Apr 09, 2008 2:37 pm
by pyrometal
lol, actually, I made this in about 7 hours total of work. Thanks for the point!

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Fri Apr 11, 2008 2:59 am
by pyrometal
hmmm... I guess no one cares enough to leave a comment here...

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Fri Apr 11, 2008 4:38 pm
by Kalladdolf
:mrgreen:
just about the thing I was gonna do.
or was it a camera walkthrough? :lol:

well done, I admire your "endurance" =D
I'm actually too lazy, I just had the flashing idea of creating virtual axis like xx, yy and zz.
and then showing them on a 2d screen.
simple idea, but takes quite some coding.

cheers :wink:

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Sat Apr 12, 2008 12:07 am
by feral
very very nice pyro.. ;)

a few quick questions, would it speed up the draw process if "lineto" was used rather then individual pixel drawing ? or would the overall speed results be the same ?

I was planning on using raster/vector graphics in a retro style 2d spaceshooter game, but it appears ?possibly? that GE is rather slow at draw functions ? is that correct ?

I ended up starting a "fake" version of a vector game because I found the draw functions too slow :cry: ,

I ended up using bitmaps :oops:

that said, if pyro's demo could be further enhanced it would be a nice tool for creating the fake bitmap versions, ie: simply design the 3d shape and screengrab each frame of rotation, then cut/paste into a bitmap "spritefile",

but, I would much rather program a "real" vector graphics game. if possible. any ideas on how to optimse this ?

pyro , would you mind if i "grabbed" a series of frames from this demo to add into my "fake version" of a vector gaming demo ? I will be posting the demo soon, but it would nice to point out that "real" vector graphics are possible, and to cross reference this thread..

nice work and thanks fro the demo.. it helped ! :D :D

a screengrab from the "fake" version below ( tho i am not sure if i should cross post like this ? if not i can delete the pic, i just thought it was relevant to this thread.. )
lasertarget.jpg
demo screengrab of fake vector graphics

feral

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Sat Apr 12, 2008 12:58 am
by pyrometal
Thanks guys!

To feral: Using the lineto() function would probably be more "effective" than the line function I'm using, the it's far less easy to use in the sense that you always have to preset the line's initial position, which is a real bother. GE's drawing function are in fact very slow, and practically unusable for making vector based games because of this (I started making such a game once, but realized how ressource consuming the methods being used were and stopped...). Optimizing this would take quite a bit of research and time, I doubt my skill level would do too much for this. You are completely welcome to use/expand/optimize/modify this tool as you wish, this is why I posted this in this demo in the first place! I just gave people a basic framework to look at. I don't mind you posting pics if it's relevant to the topic. Good luck with your game!

--pyro

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Sat Apr 12, 2008 3:16 am
by feral
thanks for the answers pyro... looks like I will need to use "fake" vectors graphics :?

your "engine" does work well for creating the sprite frames for fake vector tho :)

my first go...
pyro.gif
frame captured from pyro's polygon engine
pyro.gif (19.84 KiB) Viewed 5365 times


now all i have to do is figure out how to draw a tank :shock:

thanks again
feral

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Sat Apr 12, 2008 4:07 am
by pyrometal
Nice work! Do you think you can figure out how to code the polygons to make a tank shape? Actually a better question... Have you figured out how the program draws the polygons in? Also, I should warn you that you can only draw it in triangles... unless you somehow managed to make other shapes ( which none could have the certainty of being contained in a plane...). You could always make a "line segment in space" function by altering some of the codes!

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Sat Apr 12, 2008 4:35 pm
by Kalladdolf
you said that the GE line drawing functions are slowing down the game?
but I was just about to use the drawline function with canvas for the 3d :cry:
this creates a problem
here's what I wanna do: make a 3d camera walkthrough with GE.
(I don't use real sprites though, just lines)

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Sat Apr 12, 2008 5:08 pm
by DarkParadox
hey pyro, i found a font over the internet and i couldn't get it to work; so i took yours and edited the color to look like
the one off the internet i saved it, but now i can't figure out the initial font character.
What was the initial font character you used?

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Sat Apr 12, 2008 5:53 pm
by pyrometal
You like my font?! I made it myself in paint! You can use it if you want, the intial character is "space" (just press the spacebar).

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Sat Apr 12, 2008 5:56 pm
by pyrometal
Good luck Kall, just to warn you that your game will most likety be somewhat laggy though... Its not an easy task.

Re: Drawing 3D prisms/polygons (by pyro)

PostPosted: Sat Apr 12, 2008 6:07 pm
by DarkParadox
thanks pyro!