3D ENGINE for GE (UPDATED) mouse control is available now!

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

3D ENGINE for GE (UPDATED) mouse control is available now!

Postby cforall » Thu Aug 20, 2009 4:41 am

the demo P-51 Mustang include the updated engine.
you can share CS between different model.
I donnot post it here, just download P-51 Mustang :D

//-----history-----history-----history-----history-----history-----history-----history-----history-----

Now you can control your model by mouse! :)
I use "virtual sphere" to do rotate as many 3D CAD softwares do.
change mycode a bit: add Rotate(ScreenCS) func, replace my model, add a screencentermark.
you can add a FPS indicator to check speed.

If there is an efficient algorithm to fill polygon, the hiding of lines will be done.



3DENGINEforGE_sourcefiles_mousecontrol.zip
(287.93 KiB) Downloaded 305 times

3DENGINEforGE_exefile_mousecontrol.zip
(757.36 KiB) Downloaded 265 times

3DENGINEforGE_mousecontrol_screenshot.PNG



//-----history-----history-----history-----history-----history-----history-----history-----history-----

Several days ago, I download the "Nite Driver" demo which created by DST .
I feel it's good to be a 3D wireframe demo! :D
Then I download those two 3D demos which created by Bee-Ant.
Its very impressive and I realize it is fast enough to draw 3D wireframe on canvas! :D
:idea: Finally I create the simple 3D Engine for GE.

3DENGINEforGE_sourcefiles.zip
(287.58 KiB) Downloaded 257 times

3DENGINEforGE_exefile.zip
(766.76 KiB) Downloaded 224 times


3DENGINEforGE_screenshot.png


you can create your own model in Global code(a two-dimensional double array, you can create more than one, manual input only, of couse you can create the load/save function to make it easy);
define the CS(coordinate system) of your model(last part of that two-dimensional double array, origin and axis, you can define more than one, no need to be ORTHO);
control the model(move rotate scale, according to the coordinate axis or origin of coordinate, so it depend on your CS);
control the cam (just the Z direction of ScreenCS, but you can use model functions to do the trick);
......

but...this is just a simple one, I have on idea how to draw faces and hide lines... its so complex and I dont think I can do it. :?
I hope someone could add more features to it...
I dont add comments to code...sorry...but I will add comments if anyone need it... :D


friendly
cforall
Last edited by cforall on Thu Aug 27, 2009 1:38 am, edited 11 times in total.
User avatar
cforall
 
Posts: 65
Joined: Thu Aug 06, 2009 2:46 pm
Location: Shanghai
Score: 8 Give a positive score

Re: 3D ENGINE for GE (a simple one)

Postby skydereign » Thu Aug 20, 2009 7:22 am

Very impressive. I haven't looked at the code, but the effect is very nice. Using just a little part of this will improve its efficiancy, since all of those features would not be necessary for a full game, and since you have many features already it should be okay, and you might even be able to remove the draw actor event for just keydowns or other. The covering of lines, to produce that 3d layered effect has been done, so it is not impossible, but the problem would be filling it in. This uses a lot more canvas code, so it may slow it down, but the erasing of lines, or really not drawing of them should work out. With this you may be able to even make animated changes, if the code is versatile enough.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: 3D ENGINE for GE (a simple one)

Postby cforall » Thu Aug 20, 2009 11:21 am

skydereign wrote:Very impressive. ......


Oh man , you are very professional!
I think the code is versatile enough and very clear, it consists of several unrelated modules, easy to change.
but I dont know how to erase lines or really not draw them,
I only get "projection transformation" and "three-dimensional transform" from CGbooks.
man could you check the code and tell me how to do it?

If the feature of erasing of lines is OK I think this engine will be practical!
User avatar
cforall
 
Posts: 65
Joined: Thu Aug 06, 2009 2:46 pm
Location: Shanghai
Score: 8 Give a positive score

Re: 3D ENGINE for GE (a simple one)

Postby Kalladdolf » Thu Aug 20, 2009 3:18 pm

I'll take a look at your demo later, I didn't create NiteDriver though (it was DST XD).
The screenshot looks cool though.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: 3D ENGINE for GE (a simple one)

Postby cforall » Fri Aug 21, 2009 12:23 am

Kalladdolf wrote:I'll take a look at your demo later, I didn't create NiteDriver though (it was DST XD).
The screenshot looks cool though.


Sorry the author and the last post mix me up :oops:No doubt DST make it great!
User avatar
cforall
 
Posts: 65
Joined: Thu Aug 06, 2009 2:46 pm
Location: Shanghai
Score: 8 Give a positive score

Re: 3D ENGINE for GE (a simple one)

Postby makslane » Fri Aug 21, 2009 12:32 am

Just one word: Great!!!
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: 3D ENGINE for GE (a simple one)

Postby cforall » Fri Aug 21, 2009 12:36 am

makslane wrote:Just one word: Great!!!

Thanks :D
User avatar
cforall
 
Posts: 65
Joined: Thu Aug 06, 2009 2:46 pm
Location: Shanghai
Score: 8 Give a positive score

Re: 3D ENGINE for GE (a simple one)

Postby pyrometal » Fri Aug 21, 2009 2:12 am

lol, nice work! You reminded me that I've built something similar about 1 and 1/2 years ago: http://game-editor.com/forum/viewtopic.php?f=6&t=5545
Yours is definetly easier to manipulate though! ttyl!

--pyro
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: 3D ENGINE for GE (a simple one)

Postby cforall » Fri Aug 21, 2009 2:49 am

pyrometal wrote:lol, nice work! You reminded me that I've built something similar about 1 and 1/2 years ago: http://game-editor.com/forum/viewtopic.php?f=6&t=5545
Yours is definetly easier to manipulate though! ttyl!

--pyro


That's good, :) I just download the code and run it, I will spend some time to figure out how it works...
rotating is the hardest part of 3D transform, well done!
nice data structure of your model, a 3D array, 3 points define a face, several faces define a wireframe model, a limpid style! 8)
but is that mean the line where two faces intersect will be draw twice?
a little question: why you use a forloop and putpixel to draw lines instead of moveto&lineto? is it faster or easy to control?

I really should read your code first before I write my demo, hawhaw :)
User avatar
cforall
 
Posts: 65
Joined: Thu Aug 06, 2009 2:46 pm
Location: Shanghai
Score: 8 Give a positive score

Re: 3D ENGINE for GE (a simple one)

Postby pyrometal » Fri Aug 21, 2009 2:23 pm

cforall wrote:That's good, I just download the code and run it, I will spend some time to figure out how it works...
rotating is the hardest part of 3D transform, well done!
nice data structure of your model, a 3D array, 3 points define a face, several faces define a wireframe model, a limpid style!
but is that mean the line where two faces intersect will be draw twice?
a little question: why you use a forloop and putpixel to draw lines instead of moveto&lineto? is it faster or easy to control?

I really should read your code first before I write my demo, hawhaw


I wouldn't look too deeply into my code since its probably messy and inefficient... Its old and I didn't have the programming knowledge I have now back then. Use lineto and moveto to accomplish your drawings; I can't remember the reason I created my own line drawing function for
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: 3D ENGINE for GE (a simple one)

Postby cforall » Sat Aug 22, 2009 1:21 am

to pyrometal

Oh man your code is not messy at all its neat. :)
I thought you do putpixel intentionally...I misread it! :oops:
just forget about my silly question, haw haw.
User avatar
cforall
 
Posts: 65
Joined: Thu Aug 06, 2009 2:46 pm
Location: Shanghai
Score: 8 Give a positive score


Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest