Community
Message Board

Chat room - users
Game Over
( 394431 downloads)
Work In Progress
( 523201 downloads)
Links

Code Exchange
Downloads
Tutorials
Add to Favourites

Submit news

DIV ARENA FORUMS
Not logged in [Login - Register]
Go To Bottom

Printable Version  
 Pages:  1  2
Author: Subject: A bit of a stretch
dom cook
Div Pro
******




Posts: 387
Registered: 4-3-2016
Member Is Offline


[*] posted on 21-3-2019 at 02:31 PM


Finally I've fixed the lights (really this time) In the process I've learned that there's truth in the saying 'Short cuts make long delays'
I had to rebuild the cube to allow for normal data and I had to create a light object. Everything I tried to change seemed to introduce more unfathomable bugs. I almost resorted to typing with an axe a couple of times, then suddenly it all fell into place.

Here are 3 images showing the light source (represented by the white square) in different positions. The nearer the centre, the higher the light. it's a little subtle but you can see that the edges and faces are now correctly lit with respect to this light. Not like the last image where some of the edges, although smooth, are way too bright.

lights.png - 16kB

Last but not least I need to do the corners. I'll have to figure that out in my sleep tonight.



Attachment: DICE321e.PRG (28kB)
This file has been downloaded 901 times

Attachment: RGB.FPG (512kB)
This file has been downloaded 925 times

Arrow keys move the light around. The light is directional so moving the dice won't affect how it is lit but, if you want to, you can move it into the middle with the mouse. To get the dice at a good viewing angle press _space a couple of times.

[Edited on 21-3-2019 by dom cook]
View user's profile View All Posts By User
dom cook
Div Pro
******




Posts: 387
Registered: 4-3-2016
Member Is Offline


[*] posted on 22-3-2019 at 06:27 AM


I'm on a roll now.

on a roll.png - 14kB


Attachment: DICE322b.PRG (26kB)
This file has been downloaded 911 times
View user's profile View All Posts By User
MikeDX
DIV Nerd
*********


Avatar


Posts: 8388607
Registered: 25-2-2016
Member Is Offline


[*] posted on 22-3-2019 at 03:23 PM


Dom can you check this please and see if this is what you expect

Not sure about any version other than html working, but we can make small progress as and when feedback happens

http://js.mikedx.co.uk/dice322b.html
View user's profile View All Posts By User
dom cook
Div Pro
******




Posts: 387
Registered: 4-3-2016
Member Is Offline


[*] posted on 22-3-2019 at 07:35 PM


Quote: Originally posted by MikeDX  
Dom can you check this please and see if this is what you expect

Not sure about any version other than html working, but we can make small progress as and when feedback happens

http://js.mikedx.co.uk/dice322b.html


It's fine except for the frame rate, at least on this computer. It's running at around 9fps. The fps is set in the code to be 24.

By the way good effort. When this built in player is working properly it will be a real asset.
View user's profile View All Posts By User
MikeDX
DIV Nerd
*********


Avatar


Posts: 8388607
Registered: 25-2-2016
Member Is Offline


[*] posted on 22-3-2019 at 07:45 PM


The framerate is a real problem in html due to the way javascript works as non blocking.

Its around 23fps on my mac, but that is one beast of a machine.

At least its something. I'm going to make a page where you can upload the prg as a zip (or point to a github repo) and it generates a html page

Work in progress...
View user's profile View All Posts By User
CicTec
DIV Pro
******




Posts: 471
Registered: 6-8-2016
Member Is Offline


[*] posted on 22-3-2019 at 08:55 PM


Quote: Originally posted by MikeDX  
The framerate is a real problem in html due to the way javascript works as non blocking.

Its around 23fps on my mac, but that is one beast of a machine.

There are several aspects of the JS framerate problem...

First of all you have to consider which browser you use, for example Chrome and Opera are faster than Firefox and Mac's default browser as far as rendering and multimedia are concerned (firefox is the slowest).

Secondly, we need to consider the VM that run the JS code, some browsers run it faster than others (chrome is one of them).

Thirdly we need to see what kind of JS code is generated, being a game converted with emscripten (let's move from C -> JS) it is possible that you don't use some optimization levels like ASM.JS or the latest WebAssembly.

Finally we must consider pure rendering, DIV starts from a pure software base, according to the browser the rendering conversion/execution could be in Canvas or WebGL (or Canvas working over some WebGL), and according to the context it could give higher or lower framerate results.

Finally we find the dynamic nature of JS which as a language is naturally much slower than a C / Assembly code.
View user's profile View All Posts By User
dom cook
Div Pro
******




Posts: 387
Registered: 4-3-2016
Member Is Offline


[*] posted on 26-3-2019 at 06:51 PM
The dice have been cast.




To get the extra dice and not bring the fps into single digits (which was happening with just 2 dice), I had to reduce the quality of the images quite drastically. So then I shrunk the dice to 50% to hide the imperfections Not exactly satisfactory but, I think I actually prefer the look of these rough little dice. To my mind they're more suited to a DIV prg than any attempts at the fancy stuff.

dirtydice.png - 29kB



Anyway. This is as far as I'm taking this little project. It took a lot more effort than I was expecting it to and towards the end I got into a complete mess and ended up stressing. Still, at least it works and if I ever make a board game game I can use this.

Thanks for watching.


Attachment: DICE327.PRG (33kB)
This file has been downloaded 910 times


The graphics have been changed so this fpg is necessary
Attachment: RGB.FPG (493kB)
This file has been downloaded 934 times

[Edited on 27-3-2019 by dom cook]
View user's profile View All Posts By User
BreadCaster
Loyalty Card Holder
******


Avatar


Posts: 321
Registered: 2-3-2016
Member Is Offline


[*] posted on 2-4-2019 at 03:37 PM


it looks great Dom!!!! Say, i had a thought -

could you combine this technique with the vector 3d, by skewing the quads in a low resolution then blowing it up using something similar to the size variable - and mapping both of them to the same vertices? I mean itd be low quality but you could possibly use it to do somthing similar to what we saw in games like Elite 2.

Maybe even use the black space outside the vectors as a clipping mask and mask out the rough edges outside the vector 3d image? Just a thought/theory :D




~*~ Princess of Pies and Pastries ~*~
View user's profile View All Posts By User
dom cook
Div Pro
******




Posts: 387
Registered: 4-3-2016
Member Is Offline


[*] posted on 2-4-2019 at 05:51 PM


I don't know really. At least the way I've approached things, I've concluded that all this texturing is asking a bit too much of DIV. So it's a bit of a dead end.

Having said that, It might be possble to make some sort of game using this technique if one settled for simple coloured polygons and it certainly wouldn't hurt if DIV had a filled triangle option in its set of draw commands.
View user's profile View All Posts By User
BreadCaster
Loyalty Card Holder
******


Avatar


Posts: 321
Registered: 2-3-2016
Member Is Offline


[*] posted on 2-4-2019 at 07:01 PM


flat shaded polys would certainly be the direction for this, yeah - it seems it should be easy enough to write such a command.... no idea how personally tho lol



~*~ Princess of Pies and Pastries ~*~
View user's profile View All Posts By User
 Pages:  1  2

  Go To Top

Powered by XMB
XMB Forum Software © 2001-2012 The XMB Group
[Queries: 18]