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.

DarkBASIC Discussion / Something really tricky - good luck!

Author
Message
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 6th Jun 2004 16:56
Alright. Here it goes.
I'm not sure if this is possible but please try and help.
Can someone come up with some code that extracts one object from anoher object.
eg.


Current Projects: Dark_Worlds_Map_Editor version0.1 [email protected]
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 6th Jun 2004 17:22 Edited at: 6th Jun 2004 17:22
You mean carves a hole in it?

What do you want it for. There's almost certainly another way.
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 6th Jun 2004 20:18
yeah man, you talking about some object-memblock work which is very possible but as chris said... there should be some easier alternative to doing what your trying to do.

zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 7th Jun 2004 03:25 Edited at: 7th Jun 2004 03:29
I know how in theory, but I'm in no mood to write code for it. Read up on the mesh to memblock commands. There, you can find the FVF formats. Once you know how to read the vert data, it is fairly easy to write some code to split the verts into two groups. You should be able to create two mesh inside of two separate memblocks and from there convert those memblocks back to meshes.

Of course, it would probably be a rather silly waste of time. The meshes will NOT be closed and you'll have angles where you can look into the mesh and it will be effectively invisible since the faces are looking away from the camera, etc.

Maybe the better question is to ask is what effect are your trying to achieve and would 'pre-broken' parts be a better choice?
--
TAZ



History did not begin with PONG. -- Greg Costikyan

Game Beavers
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Jun 2004 06:56
Oh god, boolean operations on objects? It's possible in DB with memblocks, but it'd be a huge pain in the butt! I don't even know where to begin.

"eureka" - Archimedes
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 7th Jun 2004 15:25
I am making a game like Worms 3D.
Ideally I want the effect of bullets making holes in the terrain.

Current Projects: Dark_Worlds_Map_Editor version0.1 [email protected]
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 7th Jun 2004 15:56
To do that, you'd just make a mesh deformation function.

ie, you'd have a mesh that has polygons all over the place, and when a bullet hit's, you call up the mesh deformation function to lower and/or rearange some polygons to create the effect of a crater etc.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 7th Jun 2004 16:12
And how do you do that?
Please give some example code.

Current Projects: Dark_Worlds_Map_Editor version0.1 [email protected]
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 7th Jun 2004 16:17
Well, what you'd do is first convert the mesh to a memblock.

Then, you'd find the relevant vertecies, and you would alter their positions accordingly.

I can't give you any code cos that would be doing your work for you.

If you want to know how to do Mesh to Memblock, look in the help files, and there's also an example in the codebase

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 7th Jun 2004 20:31
How would you know which vertices to move?
You cant do vertex collision.
Can you?

Current Projects: Dark_Worlds_Map_Editor version0.1 [email protected]
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 7th Jun 2004 22:25
Assuming the explosions are spherical you can do it with distances ( SQRT(a^2 + b^2 + c^2) )
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 8th Jun 2004 03:14
vert coordinates + terrain world coordinates = vert world coordinate

with a spherical explosion, check the distance between the center of the explosion and the vert world coordinates. Then move that vert accordingly.

The problem though is speed. Running through all the verts in the model could be slow.

"eureka" - Archimedes
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 8th Jun 2004 15:58
I am no good at memblock editing so please just give me some code!!!

Current Projects: Dark_Worlds_Map_Editor version0.1 [email protected]
<IMG SRC=http://www.uploadimages.net/images/331935avatar2.JPG>
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 8th Jun 2004 22:35
You'll need to learn memblocks.
dj BlackDragon
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location: who knows
Posted: 19th Jun 2004 06:24
patience,patience,patience.getting mad will get you no help at all.but being a nice person i will re state something already posted.

CODEBASE
Alasdair
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location:
Posted: 23rd Jun 2004 23:28
you could use a matrix for the ground and make craters in it when bullets hit it by lowering its height but thats got nothing to do with objects. try a 3D modeler

Ireland!!!!!!!
UberTuba
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 24th Jun 2004 02:11
What you are tring to do is way to complicated.
The best solution to this problem,is building the world out of "bricks", each brick a limb. every time you have an explosion delete the limbs in its radius. That is the way worms 3d does it.
It is also relatively simple.

If you have trouble with that it is probably best to have a go at making asteroids. lots of mathematics involved, but good for learners.

Also, never , ever as "just for code", as
A: it will be someone else making the core of your game and
B: you u will not learn anything

I'm Right and Reality is lying
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 24th Jun 2004 12:37
Thanks but I've already done pong, asteroids, pacman etc.
I have already made a racing game and a simple rpg.

Current Projects: Dark_Worlds_Map_Editor version0.1 [email protected]
[img]http://www.uploadimages.net/images/331935avatar2.JPG[img]

Login to post a reply

Server time is: 2025-05-24 13:35:15
Your offset time is: 2025-05-24 13:35:15