3d Engine On The Gp2x


otaco

Still Fresh
Joined
Sep 14, 2007
Messages
91
Location
Germany, Weimar
Website
www.otaco.de
Is there a 3D engine or a lowlevel Api for 3d programming out there? I know the :gp2x has no 3d acceleration but games like payback are showing that 3d is possible. Because it is very uncomfortable to rotate sprites with the SDL I thought it must be possible to use bitmaps for all static images and animations and polygons for the characters to make more smooth animations. I wrote my own software rasterizer but its dam slow and I have no textures yet.
 
I seem to remember a 3d lib for the 2x running on the 940.

Have you looked at gpu940? Not exactly sure what it does, but it reminds me of 3d for some reason.
 
Yeti3D - It came from GBA scene.

I think it fun fun to create a 3d renderer. It is really cool experience.
 
Thanks for the fast answers. I looked over the yeti3d code and compiled the demo and like I understand it supports only rectangles but no triangles. Also its specialized for first person shooter what makes it not usable for my purposes.

gpu940 looks a bit better but I could not find any documentation for it. There are some examples in the cvs repository but everything looks very unfamiliar because of the cpu->gpu approach and the fixed point arithmetic.

I would like to have a OpenGL ES port for the :gp2x but I could not find anything like it.

Since I only want to render the players avatar but not the rest of the scene I will stick to my own rasterizer for now and improve it. I reach good framerates for about 500- 1000 triangles with no textures.

If somebody has another idea please reply...
 
There was an OpenGL ES port called Vincent by HMW. It should be in the archive... I seem to remember that it was standards complient too...
As for GPU940, it's based highly on OpenGL so aside from using fixed point, you want to use the "Red Book" OpenGL programmers' guide and the sample tutorials to get going.
 
There also FleshChasmer's sorce code on archive. But it is far away from any API.

The rectangle is nearly 25% faster to render than a two triangles, forming that rectangle.
 
quasist said:
There also FleshChasmer's sorce code on archive. But it is far away from any API.

The rectangle is nearly 25% faster to render than a two triangles, forming that rectangle.
I want to load models made of triangles. Its much more common to model objects out of triangles. Also I worked a lot with openGL in the past and can use much of my old code (loader, scenegraph, math stuff...)
 
Last edited by a moderator:
otaco said:
I want to load models made of triangles. Its much more common to model objects out of triangles. Also I worked a lot with openGL in the past and can use much of my old code (loader, scenegraph, math stuff...)
I want cool shader 2.0 effects. Hardware multitexturing megapixel fog suport for isomorphic NURBS splines with 4x interlacing...
 
Last edited by a moderator:
quasist said:
otaco said:
I want to load models made of triangles. Its much more common to model objects out of triangles. Also I worked a lot with openGL in the past and can use much of my old code (loader, scenegraph, math stuff...)
I want cool shader 2.0 effects. Hardware multitexturing megapixel fog suport for isomorphic NURBS splines with 4x interlacing...


And 0.1fps...
 
Last edited by a moderator:
Thanks PokeParadox again for the Vincent hint. I played around with this stuff but because I have not seen my gp2x (I ordered a F200) I can't test anything on it.

I've made a screenshot and a little movie to show what I want to do. I have a big background image (bigger as the screen) witch shows a cave. You can fly around in it with a little glider.

track_test_01.jpg


race_race_01.jpg


race_race.mov (2.2 MB)

Since rotating sprites with the SDL is not so comfortable I use a sequence of frames (7 angles * 60 frames >= 420 KB) to visualize the glider.

pod_420.gif


I thought it would be nice to render the glider with some sort of 3D engine to get smoother animations and save some ram.

As a workaround I tried to use the rotzoom function of the SDL_Image but if I rotate something with this, it don't rotate around it's center but dancing around somehow. Has somebody any ideas why? If I had a proper rotating function I would not need to render the glider in 3D at all (or just to pimp my game :D ).

pod.gif


Ah..., using prerendered sprite looks also better because of no aliasing and texel rambazamba...


PS.: Its a Rocketz-clone I confess :lol:
 
Thanks Imerion for the hint, I will check the source tomorrow.

I loved Rocketz too. It would be nice to have a version for the :gp2x . I'm working on it...


I even have the big fan ... but mines is moving :p

fan.gif


Has somebody an idea for the rotzoom subject mentioned above???
 
It does look like it is rotating about the center of the image to me. Look at where the tail fin and canopy come together. That looks like the center of mass (on the one axis) and rotation to me.

But, I think the problem is that the image is getting stretched. I think this is most noticeable on the wings. When the pod is sideways, the wings seem longer than when it is looking at you head on or in the opposite direction.

I do not know much about rendering, but I would say that the image's bounding box, in which it is rotating, needs to be widened (x-direction) or shortened (y-direction) from a 2-dimensional perspective. I'm not sure that makes much sense, so I will try another explanation: the bounding box's 2-dimensional projection needs to be widened.

That fan looks pretty cool!
 
Thanks donny662, but I think there is a misunderstanding. All animations you can see in my post are rendered in a 3D program (Lightwave) not by using the rotzoom function. Anyway, I solved the problem this morning by centering the rotated sprite:

Here is the original code and behavior:

CODE

SDL_Surface* dest = rotozoomSurface (_rm.loadImage("data/sprite.png"), angle, 1, 1);
SDLE::Sprite rotated(dest);
rotated.draw(__screen.get(), 50 , 50 );
SDL_FreeSurface(dest);



rotzoom_unfixed.gif




The solution is to translate the sprite in every frame with -Point(spriteWidth/2, spriteHeight/2) to center it:

CODE

SDL_Surface* dest = rotozoomSurface (_rm.loadImage("data/sprite.png"), angle, 1, 1);
SDLE::Sprite rotated(dest);
rotated.draw(__screen.get(), -rotated.getCenterOffset()[0]+150 , -rotated.getCenterOffset()[1]+150 );
SDL_FreeSurface(dest);



rotzoom_fixed.gif



Now I only have to animate the leaning of the glider and can rotate it with the rotzoom function :D
I use now a sequence of only 31 frames to lean the glider.

pod_31.gif


The rotation is realized with the rotzoom function of the SDL_image lib.

Here is a link to a movie of the rotzoom version of the demo:
race_race_rotzoom2.mov (3.6 MB)




Here is a link to the docs of my framework I'm using to program my stuff....
 
You may also want to look at my software rasterizer (look at my signature). It seems to be a lot faster than Vincent and is more low level and flexible (It would be possible to create an OpenGL layer on top of it).
It is quite modular and only uses fixed point math for performance reasons. It can interpolate an arbitrary amount of parameters across the triangle (you can choose if perspectively correct or not). You can even write your own vertex and pixel shaders in C++ which the rasterizer will use to draw your images.

In the future I may also implement an S-Buffer rasterizer (like Quake1 did).
 
Back
Top