Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Making something go boom

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 7th Sep 2018 03:54 Edited at: 7th Sep 2018 04:57
Is there a 3D equivalent to CreatePhysicsForce()? How would i go about blowing something up in 3D?


Unless there's a function for force i think i need to do it through linear velocity
which means i think i need to come up with a vector based on the center of the object (cx, cy, cz) and the center of the piece(px, py, pz). Any ideas?

Attachments

Login to view attachments
Rick Nasher
7
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 17th Sep 2018 20:08
(back from outa space)

In Blitz3d I had a nice routing for shattering glas windows(would have to convert).

I vaguely remember fubarpk doing something like this. Perhaps this is of help:
https://forum.thegamecreators.com/thread/222027#msg2624062
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Sep 2018 20:24
I did something kinda like this in DBP a long time ago. I used memblocks to just break the object down into individual triangles then just had them fall off. Basically, the object just collapsed into pieces.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 18th Sep 2018 18:04
Quote: "I did something kinda like this in DBP a long time ago. I used memblocks to just break the object down into individual triangles then just had them fall off. Basically, the object just collapsed into pieces."


You still have da codez? This maybe a solution to an effect I've been trying to create in my current project and would be fun to convert to AGK.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Sep 2018 19:46
I'll have to dig for it. I also vaguely remember someone doing this with a teapot model, I might his code as well.

I'm not familiar with AGK's 3D commands or memblock structure (i assume its pretty similar). But essentially, loop through all the verts in the memblock as created from the model in question. Then create triangles and position them accordingly, essentially reconstructing the object itself. Then, when you want to explode the object, hide the original and display the collection of triangles, moving them however you want for your intended effect. Only thing I'm pretty sure isn't accounted for is texturing. That could get tricky but doable with UV manipulation. But if you explode it fast enough enough, spinning the triangles through the air I don't think anyone would really notice if a texture was missing on the pieces.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Sep 2018 13:47
Might want to read through this
https://forum.thegamecreators.com/thread/173904
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Sep 2018 21:34 Edited at: 19th Sep 2018 21:34
This is what i ended up with. I made separate models for all the bits. (I thought separating all the polys might not look right, and it was too much work!)
The interesting thing was i didn't need to apply any forces. I'm not sure why but i think it's because their physics shapes were overlapping and that naturally pushed them away from each other.

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 19th Sep 2018 22:03 Edited at: 19th Sep 2018 22:05
i madesomething boom in my memblocks thread - maybe you missed it

work with me, ill sort your query out
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Sep 2018 22:41
No worries puzzler. I just saw that. Nice work

Login to post a reply

Server time is: 2024-11-23 05:23:54
Your offset time is: 2024-11-23 05:23:54