BBC BASIC for Windows
« 3D Gaming Project »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:51pm



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 ... 2 3 4 5 6  ...  8 Notify Send Topic Print
 veryhotthread  Author  Topic: 3D Gaming Project  (Read 1759 times)
michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
xx Re: 3D Gaming Project
« Reply #50 on: Jun 20th, 2016, 5:15pm »


I guess the next question would be:
What if I wanted to create more than one condition?

The idea being that I might want to check more than one set of values or boundaries.
This is just one condition and one result label:

cmp eax, ebx
jne loop


And I may be jumping a bit too high on this, but what about controlling the location of an object (pointer or even a sprite) or say drawing in assembly?

(seems to be the holy grail according to Richard, as he voiced his feelings about that on his forum)

But I would like to know that also.



Oh and how much memory can I reserve and how does that apply to huge information ?


Code:
 DIM code% 200                           : REM always reserve too much
      DIM test 100                            : REM reserve memory for variables (the assembler routine used here only needs 12 bytes, memory is cheap, reserve too much)
      !test=0                                 : REM make memory location (32bit dword startimg at test) equal 0
      !(test+4)=2000000                       : REM make memory location (32bit dword startimg at test+4) equal 2000000  (The +4 is in bytes ie 32bits displacement)

      FOR I% = 0 TO 3 STEP 3
        P% = code%
        [
        opt I%
  
 
« Last Edit: Jun 20th, 2016, 5:33pm 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 #51 on: Jun 20th, 2016, 5:31pm »

If you think of asm as really simple BASIC, this will probably help your understanding. If you want to test more conditions you simply load the test condition and sample it again and then use another branch, sorry jump.

In essence cmp sets the flags and all the operands beginning with j are IF statements with a THEN condition.

I am out for the evening but will send you the PDF of the asm code I used to reference each oppose.

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 #52 on: Jun 22nd, 2016, 9:32pm »

Michael,
This is the reference I used

http://www.gabrielececchetti.it/Teaching/CalcolatoriElettronici/Docs/i8086_instruction_set.pdf

Also look up simply fpu

Ric
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 #53 on: Jun 24th, 2016, 02:21am »

Thanks. I will study this.
User IP Logged

I like making program generators and like reinventing the wheel
David Williams
Developer

member is offline

Avatar

meh


PM

Gender: Male
Posts: 452
xx Re: 3D Gaming Project
« Reply #54 on: Jun 24th, 2016, 04:23am »

One idea that could save you a great deal of time, energy and potentially stress (!), is to write speed-critical code in C (or C++), compile it as a DLL and load it into your BB4W as a library, or have the C compiler generate the assembler code. Now, I realise there's an argument as to whether C compilers generate better quality (or more optimal) code than you can with hand-crafted assembly language, but often the C compiler will produce better code because it knows how to sequence (or pipeline) machine code instructions for more efficient execution (fewer stalls, etc.). What you can achieve in a few lines of C in just a few minutes can potentially take hours with assembler code (most of that time debugging), even for relatively experienced Asm coders. Some of my C-coded graphics routines (often written in the space of a few minutes!) are actually faster than their hand-coded Asm equivalents, and that's probably down to better register usage and better pipelining by the C compiler. I learnt the rudiments of C in a few days, so if I can do it.... then so can anyone! BB4W, assembly language and C (via DLLs or assembler code dumps) is such a pleasant and powerful combination.

Check out this program which includes assembly language generated by the GCC C compiler. I remember being very pleased with its efficiency:

http://bb4w.conforums.com/index.cgi?board=assembler&action=display&num=1407003986


I recently renewed my interest in learning C, specifically for the purpose of creating DLLs to be loaded into BB4W, and generating assembly language dumps. It will save so much time and hassle.


David.
--
User IP Logged

michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
xx Re: 3D Gaming Project
« Reply #55 on: Jun 24th, 2016, 04:40am »

Nice code link. I will study that.

« Last Edit: Jun 24th, 2016, 04:56am 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 #56 on: Aug 9th, 2016, 8:53pm »

Evening all, its been a long time since the last update, but babies do that to you. If you download this link :-

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

it should be the first stages of a 3D design package for BB4W.

Have a play and any feed back would be greatly appreciated.

The only menu driven item that works is:-

Add Object > Quick > huhhuh

The rotation is about the screen axis at the moment and this means that if you do not reverse the steps of each rotation then if you get back to x=0 y=0 z=0 then this might not be the true start position. I will sort the rotation later.

If you left click on the centre node of an object and hold it can be moved in the screen xy plane if you right click on the centre node then the object becomes the centre of focus. Left click on the node again to release it.

Happy playing

Ric.
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 #57 on: Aug 10th, 2016, 10:15am »

Awesome work
User IP Logged

I like making program generators and like reinventing the wheel
DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: 3D Gaming Project
« Reply #58 on: Aug 15th, 2016, 3:51pm »

Hi Ric,

That's very impressive!

I like the way you can select and manipulate a single object independently by right-clicking it. Would it be nice to change the top slider from moving the whole view nearer/further, and use it to change the absolute size of the object in this mode?

Presumably in due course we will be able to change the colour of the predefined objects, and to save them as a custom graphics file of some kind?

There's a typo in your title... wink

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 #59 on: Aug 16th, 2016, 4:56pm »

That's a good idea, shouldn't be to difficult to implement. I have the colour version ready to go apart from node highlighting. Will post it tonight.
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 #60 on: Aug 16th, 2016, 9:53pm »

Think this is the right link

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

Try solid and line, check in box does not work yet I know.

I have started to implement object scaling with top slider, it does not work yet!

Sorted typo DDRM
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 #61 on: Aug 17th, 2016, 09:40am »

Hi Ric,

That's coming along nicely - once I worked out that I now had to release the individual components using the button in the characteristics box (after saving!). Your code may be quick, but I am slow...

Are the nets for the individual components stored as an array? If the centre of the object is at (0,0,0) then scaling should be a simple matrix multiplication, but otherwise you may need a multiplication plus an offset.

Getting more demanding, would it be possible to make the sliders usable for both the individual component or the composite at the same time? It would be useful to be able to rotate the assembly to check on 3d positioning of each component as you add it. I wondered about using shift, for example. I can see that there's an issue that the slider would keep moving about... Alternatively, put a separate set of sliders on the characteristics box to move/scale the component?

Will it be possible to select and move individual nodes (and/or groups of nodes) of objects, so we can, for example modify a standard cube into a rhombus, or something?

I assume object 1 is the grid, which makes sense from your point of view, but feels a bit counterintuitive to the user. (I presume it won't form part of the final object you save). Could the display show "object 1" for my first added object, even if behind the scenes it's object(2)?

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 #62 on: Aug 17th, 2016, 9:41pm »

Evening DDRM,

Thanks for the feedback.
I will have a look at the sliders, but it could get rotationally very complicated to do everything live, without saving inbetween, never say die tho'.
The node movement is next on the list of things to do along with being able to disable the grid.
I agree about the object numbers and have made the necessary adjustment.

Next post will be a while, free time has run out again😁

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 #63 on: Sep 3rd, 2016, 7:51pm »

Hello again,

This is where I am up to so far. The axis' are displayed for demonstration purposes to allow me to develop the software. Currently they are executed using BASIC DRAW commands and thus print over the top of the graphics and are not confined to the window but this will change and they will become useful. The rotation of the objects is now around arbitory axis' and you can rotate the grid while focusing on an object. Where the node option boxes are mis-aligned, just try them, they may or may not work.

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

Ric


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 #64 on: Sep 4th, 2016, 04:24am »

On your previous (Nodes) II the sliders were all working properly. On this latest link, it seems like most the sliders are not responding and those that do, do only at times..
I have an idea, that I am trying to work out the technicalities concerning design. Its a matter of brain storming.
The thought of small game parts. Universal, that we could make.. They would be a sort of real 3D, and actually manipulated by sprites for size.
So for instance we could make sets of eyes and ears on different angles. Not like before. I have some ideas of cropped motion capture of vehicles and other real world objects to make overhead views and rear and side views.
Spy hunter anyone?
Just throwing ideas. I am working on some code art now and will show them using BMPtoCODE.
(by the way I am thinking of making a BBC Basic version of BMPtoCODE. even though I don't really need to.
I keep thinking of how a person could store the perspective views in an array instead of a sprite.
BMPtoARRAYS? Hmmmm...
The thing with arrays is, to make it fast, I would have to eliminate compression. or invent a new smart overlay system that can absorb the image data and read it fast and efficiently. So you would only create the images you needed, and the active parts would only become active depending on say a model's stance, and the different parts would be only called upon to change when the perspective or stance changed..
You know what I mean?

« Last Edit: Sep 4th, 2016, 04:33am by michael » User IP Logged

I like making program generators and like reinventing the wheel
Pages: 1 ... 2 3 4 5 6  ...  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