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  
Author: Subject: A bit of a stretch
dom cook
Div Pro
******




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


[*] posted on 11-3-2019 at 06:03 AM
A bit of a stretch


Have you ever wanted to be able to draw a textured quad in DIV?

Well now you can.

Only a few mind you. And keep them small. Those map_get_pixel functions are hard work.

Move the area to be mapped wtih the cursor keys (_left, _right, _up, _down).
Deform the quad by dragging the vertices (mouse.left)


Attachment: RGB.FPG (50kB)
This file has been downloaded 7 times



on target.png - 99kB

Attachment: SQTEX.PRG (6kB)
This file has been downloaded 8 times

[Edited on 11-3-2019 by dom cook]
View user's profile View All Posts By User
Vortigano
DIV Regular
***




Posts: 179
Registered: 12-1-2017
Location: Ciudad de Buenos Aires, Argentina
Member Is Offline


[*] posted on 11-3-2019 at 02:56 PM


I like it. You could use a collision priority and a "virtual" depth list where each element is listed, so the circles don't stick together when you press the mouse button. Later I'll go home and send you something for that.
View user's profile View All Posts By User
Vortigano
DIV Regular
***




Posts: 179
Registered: 12-1-2017
Location: Ciudad de Buenos Aires, Argentina
Member Is Offline


[*] posted on 11-3-2019 at 08:15 PM


Well arrive to home, i'll try to add something on your prg so the circles don't stick together when you press the mouse button.
View user's profile View All Posts By User
dom cook
Div Pro
******




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


[*] posted on 11-3-2019 at 08:51 PM


Thanks for the help although the vertex handles were only implented so I could easily check that the mapping was ocurring correctly. The plan is to use this texturing to make a rotating dice and I've progressed a bit from what I first posted here.
Right now it's looking like this
dice.gif - 12kB


As soon as I've got the faces glued together I'll post it in the WIPS



View user's profile View All Posts By User
Vortigano
DIV Regular
***




Posts: 179
Registered: 12-1-2017
Location: Ciudad de Buenos Aires, Argentina
Member Is Offline


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


I always thought that float variables should be necessary to achieve deformation of the texture.
View user's profile View All Posts By User
Vortigano
DIV Regular
***




Posts: 179
Registered: 12-1-2017
Location: Ciudad de Buenos Aires, Argentina
Member Is Offline


[*] posted on 11-3-2019 at 08:57 PM


Congratulations for dealing with it using integers. :)
View user's profile View All Posts By User
dom cook
Div Pro
******




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


[*] posted on 11-3-2019 at 09:04 PM


Same here, also 3D in general but although the result isn't as good as could be achieved with less effort in other languages I'm pretty happy with it. It's a nod at the world of 3D rather than an attempt to join it.
View user's profile View All Posts By User
Vortigano
DIV Regular
***




Posts: 179
Registered: 12-1-2017
Location: Ciudad de Buenos Aires, Argentina
Member Is Offline


[*] posted on 11-3-2019 at 09:21 PM


I hope my humble contribution motivates you to continue your journey. ;)

Attachment: SQTEX_VORTI.PRG (9kB)
This file has been downloaded 4 times
View user's profile View All Posts By User
Vortigano
DIV Regular
***




Posts: 179
Registered: 12-1-2017
Location: Ciudad de Buenos Aires, Argentina
Member Is Offline


[*] posted on 11-3-2019 at 09:42 PM


"Catched.got_enabled" should be outside the "repeat" haha, well i think I put some errors however it works. :lol: bye-bye!
View user's profile View All Posts By User
dom cook
Div Pro
******




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


[*] posted on 12-3-2019 at 04:48 AM


Quote: Originally posted by Vortigano  
I hope my humble contribution motivates you to continue your journey. ;)



Hey, having someone show an interest is pretty encouraging in itself. Thanks for joining in.



[Edited on 12-3-2019 by dom cook]

dice.png - 31kB
View user's profile View All Posts By User
dom cook
Div Pro
******




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


[*] posted on 13-3-2019 at 09:41 AM


I'm not sure if this belongs here anymore or should be a new thread in the WIPs but I'll post here for now.

My reason for wanting a texture was so I could make a textured cube, specifically a dice. I've played around with board game conversions before and I think a simple random number generator just doesn't work on the emotions and sense of suspense in the same way as a dice totering dice would. My goal is to capture that sense and for that I need something that actually captures the feel of a dice. First off, it's got to look like one.

It might be of potential interest to observe the process so I'll be posting as I go along. If anyone has any questions, comments or criticisms, don't hesitate to let me know.

Anyway, so far I've got a cube of sorts, but it's not satisfactory because, on closer inspection, dices (or dies or whatever) are not cubes, they've got rounded edges. To represent those, I've first pulled the faces apart slightly and then created some thicker edges to fill the gap using rows of ellipses. These are drawn, in green, on the wireframe cube next to the dice.

The next step will be to transfer them onto the dice and calculate their correct colour, which should be a shade of grey halfway between the shades on the two faces they belong to.








SNAP0014.png - 29kB
View user's profile View All Posts By User
dom cook
Div Pro
******




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


[*] posted on 13-3-2019 at 09:22 PM


Ok, It's not perfect but it's more like what I wanted.

Painting the edges the average colour of the two sides they bound doesn't work because sometimes the edge need to be shinier than either of its faces. So I ended up having to approximate their normals. Basically the more directly upwards a face or edge points the brighter it is.


dice09.png - 21kB


It's always possible to work on improving the look later but now I want to move on to effecting a convincing roll. I'm not even going to think about using anything like realistic 3d physics for this, instead I'll implement some of what I'm calling stylized physics.

Anyway here's the code so far in case anyone wants to play with it.


Attachment: DICE10.PRG (13kB)
This file has been downloaded 6 times

Attachment: RGB.FPG (75kB)
This file has been downloaded 5 times

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


Avatar


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


[*] posted on 14-3-2019 at 12:30 PM


holy moly that looks great Dom! For a quick fix you could make it a bit lower resolution/smaller final graphic to hide the slight jankiness of the edges, so people will think its a nearest neighbor style resizing glitch - but aside from that really solid looking work :D



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




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


[*] posted on 14-3-2019 at 05:08 PM


Yes I think I'll have to revisit that aspect of this little demo later when I tidy up the code. I think that currently the dice object is a bit large for the screen anyway given that it's meant to be for a boardgame style scenario. I've noticed the lighting isn't working properly too. Thanks by the way.



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




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


[*] posted on 14-3-2019 at 05:29 PM


Here's today's effort. I've been working on the style of the roll.
To be entirely honest, I have done something like this before so I know more or less where I'm going with it.
The roll has several stages reset, shuffle, align, roll, slow, stop on one edge and topple(either forwards or backwards for suspense). So for I'm up to stopping on one edge. You can run through what there is so far by following the on-screen instructions.

At the moment the dice only spins and does not travel across the screen. This will be implemented once I'm happy with the roll.

roll.png - 35kB

The wireframe and random texts are for debugging purposes.

Here's the prg

Attachment: DICE315.PRG (18kB)
This file has been downloaded 3 times
View user's profile View All Posts By User
ahmok
DIV Junior
**




Posts: 32
Registered: 31-1-2019
Member Is Offline


[*] posted on 15-3-2019 at 08:46 AM


Hello....

I have an innovative suggestion. Is it possible to make a rotating Tetrahedron? I mean this:

https://www.youtube.com/watch?v=krdrzI3hQYc

In addition, the words "DIV Games Studio" are on each side of this rotating Tetrahedron.



In conclusion, a new splash screen with this rotating Tetrahedron will be extremely fascinating and persuasive. Right?
:cool:

This nice splash screen can help to promote DIV Games Studio.
View user's profile View All Posts By User
dom cook
Div Pro
******




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


[*] posted on 15-3-2019 at 10:04 AM


Yes that would possible.
However, although a rotating textured volume might be eye catching, it's a lot of work for DIV whereas other languages can achieve it with a couple of lines of code. In my opinion, a splash screen should play to DIV's strengths and not foster unrealistic expectations about what can be achieved with it.
Having said that, if the 3d shape were rendered roughly with a few glitches here and there and thus without putting too much strain on DIV, it could work. For example, look at some of the 'independent' games that are on the market these days. I saw one yesterday which had pixels the size of lego bricks and a four colour palette. It still looked very cool.

[Edited on 15-3-2019 by dom cook]

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




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


[*] posted on 15-3-2019 at 02:48 PM


OK, I've got the roll working and resetting. So now all I have to do is get the dice rolling along in a semi-convinving way. After that it's just a case of tarting everything up a bit. Maybe I could add another dice if the computer can handle it.



on a roll.png - 21kB

Attachment: DICE315c.PRG (19kB)
This file has been downloaded 2 times
View user's profile View All Posts By User
dom cook
Div Pro
******




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


[*] posted on 18-3-2019 at 04:22 AM


So the tarting up phase is now underway.
So far I've Improved the lighting and added a perspective view. Up until now it was orthographic so when the dice was lying flat you could only see the top face. Now you can see a little bit of the sides.
If you can't see the difference, try dragging the dice around the screen with the mouse (left button.) Change view with the enter key.

diceN.png - 13kB

Attachment: DICE318.PRG (17kB)
This file has been downloaded 0 times
View user's profile View All Posts By User
ahmok
DIV Junior
**




Posts: 32
Registered: 31-1-2019
Member Is Offline


[*] posted on 18-3-2019 at 01:05 PM


Quote: Originally posted by dom cook  
Yes that would possible.
However, although a rotating textured volume might be eye catching, it's a lot of work for DIV whereas other languages can achieve it with a couple of lines of code. In my opinion, a splash screen should play to DIV's strengths and not foster unrealistic expectations about what can be achieved with it.
Having said that, if the 3d shape were rendered roughly with a few glitches here and there and thus without putting too much strain on DIV, it could work. For example, look at some of the 'independent' games that are on the market these days. I saw one yesterday which had pixels the size of lego bricks and a four colour palette. It still looked very cool.

[Edited on 15-3-2019 by dom cook]

[Edited on 15-3-2019 by dom cook]


Thanks for your detailed explanation!!!





View user's profile View All Posts By User
MikeDX
DIV Nerd
*********


Avatar


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


[*] posted on 18-3-2019 at 01:30 PM


I'm currently trying to get a working dev laptop running for DIV since my new mac is not even compiling without issue.

Once this is done, I'm going to try to get a system where you can upload a zip or a prg and assets and it will compile to a html page. This should have been done ages ago as compile as a service but it never got finished.

Hopefully then if we add this to the forum, we can embed things like this as actual forum posts, instead of images. It would be amazing to see your work in progress as a real example online dom and it truly deserves it.
View user's profile View All Posts By User

  Go To Top

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