Author |
Topic: 3D Gaming Project (Read 1748 times) |
|
Ric
Full Member
member is offline
Gender:
Posts: 136
|
|
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
|
|
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 #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...
D
|
|
Logged
|
|
|
|
Ric
Full Member
member is offline
Gender:
Posts: 136
|
|
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
|
|
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 #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 » |
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 #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
|
|
Logged
|
|
|
|
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
|
|
|
|