android
  #1  
Old 02-26-2010, 11:40 AM
xConStruct xConStruct is offline
Junior Member
 
Join Date: Feb 2010
Posts: 2
Default Simple 3D Wireframe Engine

Hey all, I'm new here!

I decided to try and build a very simple 3D engine, because the zen does not provide any functions and I wanted to check performance on this. With this, you can draw colored lines in 3D space, to build cubes or other simple objects.

My example app creates the the three axes, a gray cube and some tower-object. To rotate the camera, use the touch screen - Exit is of course on the home-button. There are some screenshots below, including the zip-archive - you can view the code directly on my GitHub repo. Don't wonder about the Dharma-thing, it's some class-based GUI-framework I'm currently developing.

Well, I didn't test the engine with large amounts of objects, but I suspect that the limit really depends on the drawing performance of the x-fi 2.
Don't think it is possible to draw solid surfaces, because we can't draw triangles with the API - and simulating them via lots of lines would possibly fail because of the CPU.

I hope, someone finds this useful or has ideas on how to improve 3D on the zen
Attached Images
File Type: jpg 3d_1.jpg (12.9 KB, 205 views)
File Type: jpg 3d_2.jpg (14.9 KB, 194 views)
Attached Files
File Type: zip 3D_Test.zip (19.2 KB, 158 views)
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 02-26-2010, 02:09 PM
RobertsAccount's Avatar
RobertsAccount RobertsAccount is offline
X-Fi2 App Master
 
Join Date: Jan 2010
Location: UK
Posts: 310
Default

Well done! Let's hope we can push the power of the X-Fi2's CPU slightly harder... Who knows what might come next!
Reply With Quote

  #3  
Old 02-26-2010, 05:36 PM
CleverBullet's Avatar
CleverBullet CleverBullet is offline
Junior Member
 
Join Date: Feb 2010
Location: Grand Rapids, MI
Posts: 12
Default

If we get texture suppot, could we see doom come out of this?
Reply With Quote

  #4  
Old 02-26-2010, 08:45 PM
nikc4 nikc4 is offline
Junior Member
 
Join Date: Feb 2010
Location: In a cardboard box
Posts: 46
Default

Games show up for a player and everyone's first thought is: DOOM
Reply With Quote

  #5  
Old 02-26-2010, 10:54 PM
CleverBullet's Avatar
CleverBullet CleverBullet is offline
Junior Member
 
Join Date: Feb 2010
Location: Grand Rapids, MI
Posts: 12
Default

well why not?
Reply With Quote

  #6  
Old 02-27-2010, 06:39 AM
keirien keirien is offline
Junior Member
 
Join Date: Feb 2010
Posts: 39
Smile

Quote:
Originally Posted by CleverBullet View Post
If we get texture suppot, could we see doom come out of this?
Im with cleverbullet we should a full 3d doom game with good graphics and everything
Reply With Quote

  #7  
Old 02-27-2010, 09:08 AM
ThievingSix ThievingSix is offline
Member
 
Join Date: Aug 2008
Posts: 218
Default

Quote:
Originally Posted by xConStruct View Post
Don't think it is possible to draw solid surfaces, because we can't draw triangles with the API - and simulating them via lots of lines would possibly fail because of the CPU.
Most likely, no DOOM.
__________________
Only ONE more functions in the Wiki need addressing!
Zen X-Fi2 LUA Wiki
Want to protect your applications? Click Here!
Tower Defense Thread
Zen Lock - Protect Your Zen!
Reply With Quote

  #8  
Old 02-27-2010, 11:15 AM
ZaPx64's Avatar
ZaPx64 ZaPx64 is offline
Member
 
Join Date: Nov 2009
Location: Germany
Posts: 136
Default

I guess the Zen already uses triangles with OpenGL of course without 3D acceleration. What's needed for a 3D rendering system is a texture or an imagebuffer where the pixels can be read and converted to texels which is impossible with lua because there is no buffering and no function to read a pixel color. Beside all that, the compuations that are needed to render a 3D scene are more complex than a simple text-editor - which laggs
__________________
Zen X-Fi2 Apps: Notee-fi (notepad) | TicTacToe | Mahjongg
http://www.starfare.eu/ - a free real-time strategy game.
Reply With Quote

  #9  
Old 02-27-2010, 02:11 PM
CleverBullet's Avatar
CleverBullet CleverBullet is offline
Junior Member
 
Join Date: Feb 2010
Location: Grand Rapids, MI
Posts: 12
Default

Personally i don't think texture support is possible either, although it would be real nice.

A game stemming directly from this could be that 3D wireframe tanks game. it's on the internets somewhere, but i can't seem to find it.

EDIT: Found It! http://www.atari.com/arcade/battlezone

Last edited by CleverBullet; 02-28-2010 at 07:29 AM.
Reply With Quote

  #10  
Old 02-28-2010, 08:37 PM
kushndonuts kushndonuts is offline
Junior Member
 
Join Date: Jan 2010
Location: Maryland
Posts: 29
Default

Excellent!
Reply With Quote

  #11  
Old 03-01-2010, 06:33 PM
cilmaviel cilmaviel is offline
Junior Member
 
Join Date: Jan 2010
Posts: 61
Default

this has some huge potential. textures may be possible if we bug creative enough and they add the ability to distort drawing images (after all they draw images at a rotation in the pic viewer).
also if you add...
Code:
for i = 1, 1000 do
    control.read()
end
in the touch.move() part of the elseif in the core file then it will respond a lot faster. the read cue gets clogged pretty fast.
Reply With Quote

  #12  
Old 03-10-2010, 12:03 PM
Tetrajak Tetrajak is offline
Member
 
Join Date: Feb 2010
Location: Oceania
Posts: 124
Default

I've bugged creative to add the Lua-GD library to their interpreter. What that would mean for this app is that you could have textures with the copy-transform functions available in the library.

I heard my request was forwarded to the 'relevant development department'. I've asked them to give me the email of said department so I can communicate directly with them. Hopefully I can get this library added and then this already awesome engine will have textures as well!
Reply With Quote

  #13  
Old 03-10-2010, 12:09 PM
RobertsAccount's Avatar
RobertsAccount RobertsAccount is offline
X-Fi2 App Master
 
Join Date: Jan 2010
Location: UK
Posts: 310
Default

Quote:
Originally Posted by Tetrajak View Post
Hopefully I can get this library added and then this already awesome engine will have textures as well!
Nice one! Let's hope so, textures would just be the icing on the cake...
Reply With Quote

  #14  
Old 03-13-2010, 02:31 AM
BattleBrat BattleBrat is offline
Banned
 
Join Date: Dec 2009
Location: Old town Pasadena, CA
Posts: 206
Default

could the arcade game "Battlezone" be made?

*EDIT* already mentioned

Last edited by BattleBrat; 03-13-2010 at 02:37 AM.
Reply With Quote

  #15  
Old 04-09-2010, 01:05 PM
3vil7ree 3vil7ree is offline
Junior Member
 
Join Date: Mar 2010
Location: Norwich, UK
Posts: 19
Default

Erm... Elite on Zen X-Fi2?
Reply With Quote

  #16  
Old 02-15-2011, 04:24 PM
wykasz wykasz is offline
Junior Member
 
Join Date: Feb 2011
Posts: 1
Default

Whell, today i did some test, of that code, results are quite good, but unfortunately to bad to create advanced project.
I was able to show 1323 ( one thousand three houndrets ..) lines (single line was about 1-5 unit long) with fps about 3-4...
for me it maybe enough.
I'm plannig to write advanced math tool, with plotting a 3D charts.

To test that script i created a simple math function ( f: R^2 - > R f(x,y)=z ).
I made calculations for 441 points, after that i used calculated values to create a simple representation of 3D chart. Actually, i drawed a net of lines between neighboring points.
I calculated about 1323 lines at all.

When i limited number of points to 111 (333 lines) it was possible to achive about 8-9 fps.
961 points (2883 lines) - 1.5-2.5 fps
1681 pionts (5043 line) - 1 fps
3721 points (11163 lines) - 1/3 - 1/2 fps

So it is possible to show squite complex scenes, but animation....
For me, for some time it should be enough.

I figured out that everything depends on:
- lenght of lines
- camDist parameter with relation with other parameters
- of course quantity of lines


Sorry for my english.
wykasz
Reply With Quote

  #17  
Old 02-16-2011, 06:32 AM
Redwolfhome's Avatar
Redwolfhome Redwolfhome is offline
Junior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 91
Default

Quote:
Originally Posted by cilmaviel View Post
this has some huge potential. textures may be possible if we bug creative enough and they add the ability to distort drawing images (after all they draw images at a rotation in the pic viewer).
also if you add...
Code:
for i = 1, 1000 do
    control.read()
end
in the touch.move() part of the elseif in the core file then it will respond a lot faster. the read cue gets clogged pretty fast.
Mh but so the screen will just update if there is any actions and so you cant create a game because the player have to touch or something to enable actions and so there canīt be monsters or something else...
And also its nearly impossible to write a real 3d game with Lua because lua is very small and it would be take years. I and Jbob are writing Pingus and the project start one year ago...
Reply With Quote

  #18  
Old 05-01-2011, 04:22 PM
rvb123's Avatar
rvb123 rvb123 is offline
Junior Member
 
Join Date: Apr 2011
Location: on earth
Posts: 45
Lightbulb

Quote:
Originally Posted by CleverBullet View Post
Personally i don't think texture support is possible either, although it would be real nice.

A game stemming directly from this could be that 3D wireframe tanks game. it's on the internets somewhere, but i can't seem to find it.

EDIT: Found It! http://www.atari.com/arcade/battlezone
I would love to see something like that! or 3d flight sim. anyone?!?!
Reply With Quote

  #19  
Old 05-12-2011, 10:46 AM
jameswalker101 jameswalker101 is offline
Junior Member
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 91
Default

Everyone has been talking about 3D for the zen... ITS HERE!
Reply With Quote

  #20  
Old 05-12-2011, 10:48 AM
jameswalker101 jameswalker101 is offline
Junior Member
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 91
Talking :-)

Quote:
Originally Posted by RobertsAccount View Post
Well done! Let's hope we can push the power of the X-Fi2's CPU slightly harder... Who knows what might come next!
Well, It doesn't use much of the Zens power at the moment... If I play music at the same time as running the app, it still works just as fast!
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 04:51 AM.