BBC BASIC for Windows
« 3D Gaming Project »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:45pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1 ... 4 5 6 7 8  Notify Send Topic Print
 veryhotthread  Author  Topic: 3D Gaming Project  (Read 1765 times)
Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #80 on: Oct 1st, 2016, 1:25pm »

Afternoon chaps, I have completed the first phase of turning the paisley triangle into a 3D image. Try this :-

https://my.pcloud.com/publink/show?code=XZ2w7eZ9CNlqYttwWSlJ7hxuJ5ztFNtDSYy

Its very slow and the algorithm for clipping backward facing side does not exist but it does demonstrate how well it is going to work. ( You still need the file "paisley" in the same folder as this file. )

Ric
« Last Edit: Oct 1st, 2016, 1:26pm by Ric » User IP Logged

It's always possible, but not necessarily how you first thought. Chin up and try again.
Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #81 on: Oct 14th, 2016, 12:21pm »

It has taken a long time to convert to ASM but here goes
(Only the raster coding is in ASM, the vector calcs are still in BASIC, this will come later)

https://my.pcloud.com/publink/show?code=XZENvnZLIQK2Mf2wUpGfhnjVz7wHutkgy87

https://my.pcloud.com/publink/show?code=XZ0qM1ZskpbmqsNIX8PCoortuysWbxY9uyy

There are two lines of code with ******* in them, if you remove the ; from the beginning then sphere will turn green so you can see the success/fail of the highlighted spot!!!!! This is due to the gouraud shading algorithm so I am now working on phong shading to address this.
User IP Logged

It's always possible, but not necessarily how you first thought. Chin up and try again.
michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
xx Re: 3D Gaming Project
« Reply #82 on: Oct 19th, 2016, 1:05pm »

Impressive work. The sphere and texture is functional. I don't know what paisley is for. It just shows a white window. Perhaps I need to wait longer?

As for the sphere, is there a way to drive in the world yet?


« Last Edit: Oct 19th, 2016, 1:08pm by michael » User IP Logged

I like making program generators and like reinventing the wheel
Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #83 on: Oct 19th, 2016, 4:36pm »

The texture on the sphere should be of Paisley pattern. Also a block pattern of Paisley should appear on the right side of the screen with the out line of the triangle to be transposed on it. There is no way of interacting yet, I am trying to get all the graphics working before I make that leap.
User IP Logged

It's always possible, but not necessarily how you first thought. Chin up and try again.
Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #84 on: Nov 4th, 2016, 10:14pm »

This is the latest attempt. I am sure you will agree that it is a vast improvement on the last routines. It has a shading engine for smooth skinning and is 60 to 65% faster than before. I will implement them into the design package soon, but for now I would be grateful if someone could run them on a machine better than mine and give me feed back on the fps at 16 faces and diameter of 200 and 30 faces at 300 diameter.

https://my.pcloud.com/publink/show?code=XZ8snTZq9Cw6m1zfp8pUIk2bDHxL74zthOX

and you will need

https://my.pcloud.com/publink/show?code=XZmsnTZId8TOsQmzbS510PXlEMtdHBFAtXX

The effect should be a green ball with purple dots.
Happy viewing
Ric

As an aside does anyone know anything about multicore functions?
« Last Edit: Nov 4th, 2016, 10:17pm by Ric » User IP Logged

It's always possible, but not necessarily how you first thought. Chin up and try again.
David Williams
Developer

member is offline

Avatar

meh


PM

Gender: Male
Posts: 452
xx Re: 3D Gaming Project
« Reply #85 on: Nov 5th, 2016, 09:11am »

Nice bit of code, Ric!

You weren't a demo coder in the past, were you? I may have asked you this before.

On my system (Intel Core i7-4790 @ 3.60 GHz, Windows 10 64-bit):

16 faces, radius 200: 248 fps
30 faces, radius 300: 143 fps

(although, of course, the frame rates vary a bit from one run to the next)


David.
--
« Last Edit: Nov 5th, 2016, 09:13am by David Williams » User IP Logged

Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #86 on: Nov 5th, 2016, 12:26pm »

Thanks very much for the compliment and information David, but no I was not a demo coder. Very early on in my coding history ( I was about 11 and 6502 ) I discovered that if you do not annotate ASM to death it is impossible to read even simple code that you have written yourself, never mind anyone else.

The information about speed you have supplied would suggest that a full screen 3D scroll might be achievable at about 30 fps on a modern machine, which is not too shabby, but some where closer to 60 fps would produce a better result. The answer to the question about multi-coring hopefully might give a route to this goal.

Do you know if it is possible to run two independent (ie running in parallel not sequentially) ASM routines from the same BB4W program?

I know multi-threading is possible, but I would like to have a routine running in the background (another core) that can be triggered from another routine by changing a memory location to switch it on.

Here's hoping

Ric
User IP Logged

It's always possible, but not necessarily how you first thought. Chin up and try again.
Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #87 on: Apr 5th, 2017, 7:48pm »

Evening folks,

Sorry ive been away for a while with no updates, but this is because there were no updates to give. It has taken a long time to get to this stage as you can tell by the file name (some of the attempts had 30 subsections),
it turns out that one can get bogged down with fancy mathematics trying to interpolate 1/z or using triangular numbers to correct the perspective, but the solution I have come up with is much simpler, both mathematically and more importantly, in the coding. I have simply interpolated the perspective corrected z, spritex and spritey values and the inverse perspective corrected them to produce the correct appearance. SIMPLE!!!!!!!!Not.
Unfortunately the speed has taken a hit, although more than I hoped, not as much as I had feared losing about 22%.

"z" and "x" rotate around the x axis
"y" and "u" rotate around the y axis
"m" and "n" rotate around the z axis

https://1drv.ms/u/s!AqibHqCkE1VQkF-dXatZ8cCHNSaO

Let me know if the download works?
User IP Logged

It's always possible, but not necessarily how you first thought. Chin up and try again.
DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: 3D Gaming Project
« Reply #88 on: Apr 6th, 2017, 08:08am »

Hi Ric,

Glad to hear that you are still making progress!

The download seemed fine, but when I run it I just get a wide (too wide for my monitor!) black window with nothing in it to rotate, and no obvious menus or any controls to make/load a shape?

Best wishes,

D
User IP Logged

Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #89 on: Apr 6th, 2017, 10:13am »

Thanks DDRM.
I don't know why this is, can you access the code? The window that opens should be the same as it always was 1346,674 pixels. There is only a grid to rotate which is done with the keys above. Can you let me know further so if necessary I can change the delivery method.

Regards Ric
User IP Logged

It's always possible, but not necessarily how you first thought. Chin up and try again.
Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #90 on: Apr 8th, 2017, 09:46am »

I have changed the size of the window that opens so it should be suitable for all screen sizes, the demo isn't that interesting I know, it is just to demonstrate perspective correct rastering. When the demo loads you should get a blank window with the grid perpendicular to the screen giving the impression it is not there, play with the keys above and it will appear.

https://1drv.ms/u/s!AqibHqCkE1VQkGByTy3QTb7XS5ai

Regards Ric
User IP Logged

It's always possible, but not necessarily how you first thought. Chin up and try again.
DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: 3D Gaming Project
« Reply #91 on: Apr 8th, 2017, 2:35pm »

It works!

It probably worked before, but I couldn't see anything: it never occurred to me that that was because it was edge-on...

smiley

D
User IP Logged

Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #92 on: Apr 9th, 2017, 08:01am »

Thanks D
Next phase is to turn rotations to arbitory axis instead of screen axis, and then implement mouse controls but no like last time.

Ric
User IP Logged

It's always possible, but not necessarily how you first thought. Chin up and try again.
Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #93 on: Apr 19th, 2017, 9:23pm »

Evening guys

I have been working on making the grid controlable by mouse. Not that difficult in itself, but harder to make it intuitive. Here is what I have come up with.

Try clicking and holding the left button and moving the mouse and then try clicking and holding the right button and then move the mouse.

https://1drv.ms/u/s!AqibHqCkE1VQkGboDYD849xXcOL-

Can you let me know how it feels.

Regards Ric
« Last Edit: Apr 19th, 2017, 9:25pm by Ric » User IP Logged

It's always possible, but not necessarily how you first thought. Chin up and try again.
DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: 3D Gaming Project
« Reply #94 on: Apr 20th, 2017, 08:17am »

Hi Ric,

That seems to work nicely: the behaviour with the left button seems pretty intuitive. I'm not quite sure what the right button is doing: moving the mouse sideways moves the grid, but moving the mouse forwards and backwards moves the pointer but not the grid, thus allowing you to reposition the pointer? It seems over-sensitive? What is the number displayed?

best wishes,

D
User IP Logged

Pages: 1 ... 4 5 6 7 8  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls