abi>>forums

abi>>forums (http://www.anythingbutipod.com/forum/index.php)
-   Zen X-Fi2 Applications & Development (http://www.anythingbutipod.com/forum/forumdisplay.php?f=221)
-   -   Simple 3D Wireframe Engine (http://www.anythingbutipod.com/forum/showthread.php?t=52902)

xConStruct 02-26-2010 11:40 AM

Simple 3D Wireframe Engine
 
3 Attachment(s)
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 ;)

RobertsAccount 02-26-2010 02:09 PM

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

CleverBullet 02-26-2010 05:36 PM

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

nikc4 02-26-2010 08:45 PM

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

CleverBullet 02-26-2010 10:54 PM

well why not?

keirien 02-27-2010 06:39 AM

Quote:

Originally Posted by CleverBullet (Post 446240)
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

ThievingSix 02-27-2010 09:08 AM

Quote:

Originally Posted by xConStruct (Post 446161)
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.

ZaPx64 02-27-2010 11:15 AM

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 ;)

CleverBullet 02-27-2010 02:11 PM

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

kushndonuts 02-28-2010 08:37 PM

Excellent!

cilmaviel 03-01-2010 06:33 PM

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.

Tetrajak 03-10-2010 12:03 PM

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!

RobertsAccount 03-10-2010 12:09 PM

Quote:

Originally Posted by Tetrajak (Post 449795)
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... :D

BattleBrat 03-13-2010 02:31 AM

could the arcade game "Battlezone" be made?

*EDIT* already mentioned

3vil7ree 04-09-2010 01:05 PM

Erm... Elite on Zen X-Fi2?

wykasz 02-15-2011 04:24 PM

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.... :D
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

Redwolfhome 02-16-2011 06:32 AM

Quote:

Originally Posted by cilmaviel (Post 447150)
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...

rvb123 05-01-2011 04:22 PM

Quote:

Originally Posted by CleverBullet (Post 446454)
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?!?!

jameswalker101 05-12-2011 10:46 AM

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

jameswalker101 05-12-2011 10:48 AM

:-)
 
Quote:

Originally Posted by RobertsAccount (Post 446196)
Well done! Let's hope we can push the power of the X-Fi2's CPU slightly harder... Who knows what might come next! :D

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!


All times are GMT -5. The time now is 03:31 AM.