Jump to content
IGNORED

(demo) 3d engine


DrTypo

Recommended Posts

Well, adding rotation axis is not too hard. At least if I don't bother to do it efficiently.

One problem with Cubixx is that it uses both "flat" shading and wireframe. My engine doesn't handle wireframe, so some work is required here.

But the biggest problem is that the laser cuts the cube, which means generating new geometry on the fly. I fear I'm not elite enough to pull this off on the Jag.

As I said; 3D, fun, easy to do: pick two.

 

Link to comment
Share on other sites

6 hours ago, DrTypo said:

Well, adding rotation axis is not too hard. At least if I don't bother to do it efficiently.

One problem with Cubixx is that it uses both "flat" shading and wireframe. My engine doesn't handle wireframe, so some work is required here.

But the biggest problem is that the laser cuts the cube, which means generating new geometry on the fly. I fear I'm not elite enough to pull this off on the Jag.

As I said; 3D, fun, easy to do: pick two.

 

I understand. Then maybe simplify it to a set wireframe/3D shape and then recolor faces while avoiding stuff? 

A concept similar to Painter, but in 3D:

 

 

Edited by agradeneu
Link to comment
Share on other sites

16 hours ago, DrTypo said:

As I said; 3D, fun, easy to do: pick two.

I am a big fan 3D vector arcade games. Such as Tailgunner, Starhawk, Battlezone, Red Baron, Tempest, Star Wars etc.

An upgrade of any of these concepts using flat shaded polygons instead of line vectors, would be a huge upgrade like Tempest 2000 was.

(no need for any outline vectors, just pure flat shaded polygons)

 

These games should have fairly limited number of surfaces to process, Battlezone is limted to rotations around the y-axis, Red Baron to rotations around the x-axis. Tailgunner, and Starhawk both have a fixed viewpoint.

 

I might take on Tailgunner myself, I have a 3D engine with fixed viewpoint, but 3D transformations are slow since they are currently made on the 68000.

@DrTypo, if you have tips on getting started to implement 3D transformations on any of the RISC processors, it would be helpful

(but I am not an assembler guru myself, so I would need to learn more)

 

  • Like 2
Link to comment
Share on other sites

@phoboz: I watched a bit of Tailgunner gameplay. It has a fixed viewpoint but the ships rotate and move in all directions. So you still need to implement full transformation on the objects.

I avoided this issue by having the objects rotating only about this y-axis and the camera also rotating about the y-axis. I could add more axis of rotations by computing the rotation one at a time but it wouldn't be very efficient.

To do it more efficiently you have to use matrices or quaternions to compose the transformations.

I have not tackled the problem of doing matrix math with fixed point number. It is certainly doable, I don't think 3D games from the 80's used floating point. But it must require extra-care to avoid overflow.

 

I can surely help you on your 3D engine. You say the transformations are made on the 68000: are they written in 68000 assembly? If yes, switching to the RISC won't be that hard.

First tip I can give: if you want to start with one of the RISC, choose the GPU. There are fewer weird pipleline bugs than the DSP.

I can share the source code of my 3D engine but there are dependencies on the U-235 sound engine. The U-235 sound engine itself isn't used but I made a library (a poor man's Raptor :D ) that is dependent on it. I'll see what I can do.

 

Link to comment
Share on other sites

Here is the source code. I just removed DSP.OBJ (u235 sound engine) from the u235se folder. So you need to grab it from the U-235 website (version is 0.24) otherwise there will be linker errors.

To build the thing you also need:

- rmac

- rln

- vbcc

vbcc must be configured to have default include folders point to a folder with JAGUAR.H from the Jaguar SDK. See vc.cfg.

The environment variable RMACPATH must be set to a folder with JAGUAR.INC from the Jaguar SDK.

 

 

 

clip_sa.zip

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, DrTypo said:

I avoided this issue by having the objects rotating only about this y-axis and the camera also rotating about the y-axis. I could add more axis of rotations by computing the rotation one at a time but it wouldn't be very efficient.

To do it more efficiently you have to use matrices or quaternions to compose the transformations.

Yes, the engine uses matrices, and supports rotations around x,y, and z-axis.

No viewports transformations are supported, just object transformations. Which I believe would be sufficient for a Tailgunner look-alike.

 

1 hour ago, DrTypo said:

I can surely help you on your 3D engine. You say the transformations are made on the 68000: are they written in 68000 assembly?

No, the code to perform 3D transformations is written entirely in C. I put the code in a public repo just for reference:

https://github.com/phoboz/reargunner2k

(to compile you also need the Removers' library, and jlibc, so these libraries contain the assembler routines for drawing polygons etc.)

 

I had to experiment with the fixed point precision and size of the object space to avoid overflows.

 

I also share a small demo, e.g. rotation of 2 pyramids around the x-axis. These can also be moved using the joypad (x,y), and bottons C & A (z-axis) It is probably running very slowly, without having done any benchmarking, but I base assumption on that it runs much faster in Virtual Jaguar, than what it does on a real Jaguar. Considering that there are only a few surfaces, the performance must be improved to make something useful out of this...

 

reargunner2k.cof

 

Thank you for sharing your code, I will check that out as well...

 

 

Edited by phoboz
  • Like 1
Link to comment
Share on other sites

Thanks for sharing the code.  Above my head as I've long forgotten all my maths except for the "soul crushing" business software (estimates, forecasts, plans, kill me).  Fun to look at and see what the post 8-bit Ataris are doing.  I own them all, but have only coded for 8-bit.

Link to comment
Share on other sites

On 4/19/2021 at 9:44 AM, DrTypo said:

Well, adding rotation axis is not too hard. At least if I don't bother to do it efficiently.

One problem with Cubixx is that it uses both "flat" shading and wireframe. My engine doesn't handle wireframe, so some work is required here.

But the biggest problem is that the laser cuts the cube, which means generating new geometry on the fly. I fear I'm not elite enough to pull this off on the Jag.

As I said; 3D, fun, easy to do: pick two.

 

How about something like Alpha Waves?
 

https://en.m.wikipedia.org/wiki/Alpha_Waves

 

It was originally just a tech demo the programmer did to test his 3D skills; he planned to make an adventure game, but when a publisher saw his demo & thought it was fun, he decided to sell as the final concept.

Link to comment
Share on other sites

On 4/20/2021 at 9:41 PM, DrTypo said:

Here is the source code. I just removed DSP.OBJ (u235 sound engine) from the u235se folder. So you need to grab it from the U-235 website (version is 0.24) otherwise there will be linker errors.

To build the thing you also need:

- rmac

- rln

- vbcc

vbcc must be configured to have default include folders point to a folder with JAGUAR.H from the Jaguar SDK. See vc.cfg.

The environment variable RMACPATH must be set to a folder with JAGUAR.INC from the Jaguar SDK.

 

 

 

clip_sa.zip 88.86 kB · 8 downloads

thanks for sharing your code. I can't see "vc.cfg" file, is it clip_sa.ppr?

 

Link to comment
Share on other sites

1 hour ago, Cyprian said:

thanks for sharing your code. I can't see "vc.cfg" file, is it clip_sa.ppr?

 

clip_sa.ppr is a project file for the PSPad editor.  It may be handy if you use this editor but you don't need it to compile.

I think I got vc.cfg from my vbcc instal but it doesn't seem to be included by default in vbcc installation archive now.

 

vc.cfg is the compiler configuration file. The compiler looks for this file in $VBCC\config. VBCC is an environement variable.

For example, if your vc.cfg is in C:\MyJaguarDevPath\bin\config, set the env variable VBCC to C:\MyJaguarDevPath\bin

The contents of the vc.cfg file is something like:

-cc=vbcc -quiet %s -o= %s %s -O=%ld -IC:\MyJaguarDevPath\include -IC:\MyJaguarDevPath\projects\MyInclude
-ccv=vbcc %s -o= %s %s -O=%ld -IC:\MyJaguarDevPath\include -IC:\MyJaguarDevPath\projects\MyInclude
-as=vasm -quiet -mid=0 -Faout -phxass -opt-pea -opt-clr -opt-fconst %s -o %s
-asv=vasm -Faout -mid=0 -phxass -opt-pea -opt-clr -opt-fconst %s -o %s
-rm=del %s
-rmv=del %s
-ul=-l%s
-cf=-F%s
-ml=10000

It's the -I option that defines the default include files search path. Your JAGUAR.H should be in one of the path defined.

 

You can find the latest vbcc here: http://www.compilers.de/vbcc.html

 

 

Link to comment
Share on other sites

On 4/21/2021 at 12:58 AM, pacman000 said:

How about something like Alpha Waves?

Ah! I played Alpha Waves on my Atari ST a while ago. I liked it but I don't think I'd make a similar game.

Something like BattleZone remains the most realistic option but it still requires quite some work to be fun to play.

 

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...