BBC BASIC for Windows
« 3D Gaming Project »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:50pm



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 1747 times)
michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
xx Re: 3D Gaming Project
« Reply #75 on: Sep 18th, 2016, 1:20pm »

Perfect! I think I have an idea of how it works.

And you posted it just in time. I am working on toon body parts that actually have function. ( I have free time to work on projects.)

Once I get a proper sample done, I think it will help some people with toon animations and game piece creation tools.
Why build each piece from the ground up, when you can just place the piece or many and it can be instructed to follow commands?

It will probably take me all day to get the first piece designed.

Is it alright for me to share my animation tools with this code on Richards forum and on the group board?

« Last Edit: Sep 18th, 2016, 1:23pm 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 #76 on: Sep 18th, 2016, 3:07pm »

Of course, the code is originally Richards I think.
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 #77 on: Sep 27th, 2016, 9:27pm »

Just thought I would share this, I have now sorted the triangle algorithm and this is the result. As a bonus I have added shading in the gouraud style.

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

Keep the number of sides down below 15 and use
node 0 shade 100
node 1 shade 0
node 2 shade 200

to demonstrate the effects.

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 #78 on: Sep 27th, 2016, 9:38pm »

The image 'Paisley' is missing, resulting in a "Invalid channel" error.


David.
--
User IP Logged

Ric
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 136
xx Re: 3D Gaming Project
« Reply #79 on: Sep 28th, 2016, 07:27am »

Thanks David,

I was very tired and off to bed last night when I posted. The two links should have been :-

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

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

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 #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.
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