Author |
Topic: 3D Gaming Project (Read 1766 times) |
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #95 on: Apr 20th, 2017, 08:42am » |
|
Thanks D
When the right mouse button is pressed the grid should rotate about the screen z axis. I will adjust the sensitivity and repost.
The number is the angle of the mouse to the z axis in relation to the centre of the screen.(in radians) it's only there so I could check stuff was working.
Regards Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #96 on: Apr 28th, 2017, 8:13pm » |
|
Hello
In reply to DDRM I have adjusted the sensitivity of the mouse input and I have introduced a pool ball image to help with fathoming the rotations.
Have a go and let me know
The image is about 25fps
https://1drv.ms/u/s!AqibHqCkE1VQkHRi24qaQHvtiziR https://1drv.ms/u/s!AqibHqCkE1VQkHWaYrfbgUkur7Pq
Regards Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: 3D Gaming Project
« Reply #97 on: Apr 29th, 2017, 08:25am » |
|
Hi Ric,
It works nicely: fast and smooth. I chose 24 "vertical sides" or whatever it asked for, which seemed to be a good compromise. I could see a little tear-out at the top of the ball, but it wasn't offensive. I tried a lot more (128), and it became a lot worse - I guess it's an edge effect (are the adjacent sections overwriting each other, or something?). 12 looked pretty good, but the ball was distinctly not round!
Understanding what the right mouse button does means it makes a lot more sense - rotates around the axis running straight out of the screen.
Best wishes,
D
|
|
Logged
|
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: 3D Gaming Project
« Reply #99 on: May 10th, 2017, 08:24am » |
|
Hi Ric,
I found 1 or 2 threads about the same speed, and about 30% faster than "no threads". The four threads version slowed to a crawl - about 10% of the speed of the 1 thread version. This is a quad-core machine, so with nothing else happening (very unlikely on a networked machine with my email running!), in principle using up to 4 threads (total) might give a speed gain.
Obviously you can't actually have "no threads", or the processor wouldn't process, so is your thread number "additional threads"?
It's actually not surprising that things slow down with too many ("parallel") threads, though perhaps it's surprising that the slow down is so severe.
If the number of threads exceeds the number of processors/cores available, at least one processor will end up having to run more than one thread. There will probably be a significant overhead as it switches between, them, too.
It depends a bit on how you arrange your "parallel" processing. If you have to keep things in synchrony (for example if each thread renders 1/n of each frame), then any delay on one thread will result in all the others sitting doing nothing for a substantial time.
In a perfect world, having n+1 threads might result in core 1 having to run two threads, thus taking twice as long to get the data for a single frame. Of course, if it is switching multiple times between the two threads, to give them each a "fair crack of the whip", the overheads will go up substantially.
In a less perfect world, the operating system might keep core 1 for monitoring my email, core 2 for doing all the multitudinous other things happening in the background, give thread 1 to core 3, and then share core 4 amongst the other 3-4 threads, switching between them every ms or so. That would have a catastrophic effect on performance.
In contrast to CPUs, which typically have 1-4 cores, I understand that graphics processors are often designed to use multiple parallel processes. Do you have a graphics card? Is there any way of getting your threads to run on those? You'd need to talk to Richard about that, I suspect... or consider using DirectX, which presumably does exactly that...
Best wishes,
D
|
|
Logged
|
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #100 on: May 10th, 2017, 6:59pm » |
|
Yep, your right, that's the conclusion I came to too. I am looking in to Direct X as x86 doesn't run on the graphics cards. Now I understand how to produce the graphics routines Direct X I think is going to be a good solution combined with x86 asm to do all the calculations.
Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #101 on: Jul 7th, 2017, 1:52pm » |
|
Afternoon guys,
I have finally cracked the slight breaking out of the pixels and here are the results.
Although this is all still a step backwards from the design package I had to sort it all before carrying on.
Have a play with the parameters and let me have some feedback.
Just for a gag I have made the light source orbit the object.
https://1drv.ms/f/s!AqibHqCkE1VQkSXPQeI-oWX3eMU4
Regards Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
michael
Senior Member
member is offline


Posts: 335
|
 |
Re: 3D Gaming Project
« Reply #102 on: Jul 8th, 2017, 2:23pm » |
|
Excellent work on the spinning earth with lighting
|
|
Logged
|
I like making program generators and like reinventing the wheel
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #103 on: Jul 8th, 2017, 5:56pm » |
|
Thanks Michael, have you tried playing with the parameters? Note the fps when you choose flat side colour cube.
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
michael
Senior Member
member is offline


Posts: 335
|
 |
Re: 3D Gaming Project
« Reply #104 on: Jul 9th, 2017, 02:38am » |
|
Quote:| have you tried playing with the parameters |
|
Yes I have.
One suggestion. I am thinking you are able to handle multiple objects on the same screen. Perhaps a turn based application like a 3D board game could be made with predefined shapes that can have textures.
The speeds I am seeing are plenty fast for most gaming applications or 3D design apps.
I would think focusing on making a shape library for the 3D world and making it easy to locate using perhaps a command like:
PROCsphere(x,y,z,rotx,roty,scale,spherenumber)
x- right/left coordinates y-distance coordinate z-up down coordinate rotx - facing side rotate clockwise roty- facing side roll scale - size of sphere at closest range
spherenumber- would allow many spheres of different sizes and positions to exist
Just some ideas
|
|
Logged
|
I like making program generators and like reinventing the wheel
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #105 on: Jul 9th, 2017, 07:02am » |
|
You are right, but a little ahead of my plans. . My next step is to finish the object designer I was working on before I had the triangle dilemma. This will enable you to create your own object library and then call them with a PROC or something similar.
Cheers
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
David Williams
Developer
member is offline

meh

Gender: 
Posts: 452
|
 |
Re: 3D Gaming Project
« Reply #106 on: Nov 9th, 2017, 07:06am » |
|
Any updates on this project, Ric?
|
|
Logged
|
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #107 on: Nov 11th, 2017, 10:21pm » |
|
Yes is the short answer. I have had to take a very quick crash course in quarternians, not an easy subject to find laymans terms on. However this has now been solved and a new IDE has been introduced to boot. The problem I have is that the tool bar in the new window requires many images to be present to load up and I do not know how to pass these images on, other than to give links to them all, is there an easier way? If this can be solved I will post the latest update which includes a few rotation tricks and arbitory axis rotation.
Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
David Williams
Developer
member is offline

meh

Gender: 
Posts: 452
|
 |
Re: 3D Gaming Project
« Reply #108 on: Nov 12th, 2017, 02:45am » |
|
on Nov 11th, 2017, 10:21pm, Ric wrote:| The problem I have is that the tool bar in the new window requires many images to be present to load up and I do not know how to pass these images on, other than to give links to them all, is there an easier way? |
|
I don't think I can help, but maybe someone else here can? I think Richard is the best person to ask (on the other forums), and doing so usually gets results!
David. --
|
|
Logged
|
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: 3D Gaming Project
« Reply #109 on: Nov 14th, 2017, 08:07am » |
|
Hi Ric,
Not sure I understand the question: do you mean how do you make the images available to us, so we can see your progress? Can you package them as a single zip archive?
If you compiled your program to an exe, it would have all the resources packaged with it? That has the downside that we can't see the code, but I'm not sure how many of us are going to dissect it that carefully, especially if it means learning about quaternions first! If you want comments on it, you could provide the source code separately.
On the topic of quaternions, fancy providing us with an idiot's guide? Ideally you could post it on the the BBC Basic Wiki...
If your question is whether there is a better way to get them into your program than a long list of load commands, I don't know of one, which isn't the same as saying there isn't one... One option might be to combine them in one big image, and then blit the relevant bit into individual images in memory, but I can't see that that's any easier - indeed, probably harder!
Best wishes,
D
|
|
Logged
|
|
|
|
|