3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1] 2

Author Topic: Totally destructable objects  (Read 2226 times)

« on: May 05, 2010, 07:40:29 PM »
How do you make it so that your; car, tank, plane etc. can fall apart into multiple peices? Do you use joints or something?
3Drad Version: 6.51, and 7.11

System Specs:
MS Windows 7 Home Premium 64-bit
AMD Athlon Neo X2 Dual Core Processor L335, 4.0GB RAM
ATI Radeon HD 3200 Graphics
250 MB Hardrive
HP Pavillion dm3 Laptop

Total Donation Amount:$24

Location: Edmonton, Alberta

Email: [email protected]

PsychoWeasel9

« Reply #1 on: May 05, 2010, 07:48:43 PM »
YES the only problem is so many joints and bodies eat up resources. :(
« Reply #2 on: May 05, 2010, 07:49:43 PM »
I guess but how do you make them fall apart? ???
3Drad Version: 6.51, and 7.11

System Specs:
MS Windows 7 Home Premium 64-bit
AMD Athlon Neo X2 Dual Core Processor L335, 4.0GB RAM
ATI Radeon HD 3200 Graphics
250 MB Hardrive
HP Pavillion dm3 Laptop

Total Donation Amount:$24

Location: Edmonton, Alberta

Email: [email protected]
« Reply #3 on: May 05, 2010, 08:04:46 PM »
eventon... stop fixed joint

Currently using 7.22
« Reply #4 on: May 05, 2010, 08:10:44 PM »
Thanks
3Drad Version: 6.51, and 7.11

System Specs:
MS Windows 7 Home Premium 64-bit
AMD Athlon Neo X2 Dual Core Processor L335, 4.0GB RAM
ATI Radeon HD 3200 Graphics
250 MB Hardrive
HP Pavillion dm3 Laptop

Total Donation Amount:$24

Location: Edmonton, Alberta

Email: [email protected]
« Reply #5 on: May 06, 2010, 04:24:19 PM »
if you were willing to script you could use a child offset function to hold the disabled body piece in place untill to you were ready for it to fall off. would save on joints at least and those body pieces wouldn't need to be enabled until then either. haven't tested that out in rad but might be worth a try  :-\.
using 3Drad 7.22

system specs:
Windows 7 Home Premium 64-bit
Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz (4 CPUs), ~3.2Ghz
8 gig ram
Geforce GTX 650 1024 MB GDDR5
DirectX 11
« Reply #6 on: May 06, 2010, 04:35:45 PM »
Well if thats the case I'd better learn scripting. :)
3Drad Version: 6.51, and 7.11

System Specs:
MS Windows 7 Home Premium 64-bit
AMD Athlon Neo X2 Dual Core Processor L335, 4.0GB RAM
ATI Radeon HD 3200 Graphics
250 MB Hardrive
HP Pavillion dm3 Laptop

Total Donation Amount:$24

Location: Edmonton, Alberta

Email: [email protected]
« Reply #7 on: May 06, 2010, 08:06:22 PM »
1st step: ask the geneious what a "child offset function" is... ;)
CsharpJsharp.com: the computer nerd site. Accepting suggestions!




Windows 7 on Acer Aspire 5735 laptop
Pentium Dual-Core T3200
732 MB Mobile Intel Graphics Accelerator 4500M
2GB DDR2 RAM
« Reply #8 on: May 06, 2010, 08:12:06 PM »
1st step: ask the geneious what a "child offset function" is... ;)
That is the second step. The first step is to learn to be able to write code independently. First step seems so far away....... :'(
3Drad Version: 6.51, and 7.11

System Specs:
MS Windows 7 Home Premium 64-bit
AMD Athlon Neo X2 Dual Core Processor L335, 4.0GB RAM
ATI Radeon HD 3200 Graphics
250 MB Hardrive
HP Pavillion dm3 Laptop

Total Donation Amount:$24

Location: Edmonton, Alberta

Email: [email protected]
« Reply #9 on: May 06, 2010, 09:46:03 PM »
Yea, what is this child offset function? Possibly the iObjectBone functions?

Akz251: Scripting is fun and easy. Just print out a Script Object Reference booklet and you'll become a pro in no time.
You can find it in the script object help file or in the documentation somewhere.
« Last Edit: May 06, 2010, 09:55:02 PM by Rush3Fan »
« Reply #10 on: May 06, 2010, 09:47:51 PM »
well, you see, Main() went and had a child with iObjectStart() and the Child was born! :D
hope you all get my humour... ;)
CsharpJsharp.com: the computer nerd site. Accepting suggestions!




Windows 7 on Acer Aspire 5735 laptop
Pentium Dual-Core T3200
732 MB Mobile Intel Graphics Accelerator 4500M
2GB DDR2 RAM
« Reply #11 on: May 06, 2010, 10:15:28 PM »
 :)

below are 2 child functions.

the first is used if you just want to place a object at an offset position relative to the parent object.

the second is like the first except it automatically orientates the child to the parents orientation.

parent is your parent object
child is the object you want to attach
Offset is a location to place the child relative to the parent

hope that helps abit.

Code: [Select]
//******************************************************************
//FUNCTIONS - PARENT CHILD OFFSET
//******************************************************************
void ObjectParentObjectChildOffset(int Parent,int Child,Vector3 Offset)
{
    //---------------------------------------------------------------
   Vector3 parent_loc;
   Vector3 real_offset;
   Vector3 child_loc;
   Quaternion parent_rot;
   
   iObjectLocation(Parent,parent_loc);
   iObjectOrientation(Parent,parent_rot);
   
   iVectorRotate(real_offset,Offset,parent_rot);
   
   child_loc.x = parent_loc.x + real_offset.x;
   child_loc.y = parent_loc.y + real_offset.y;
   child_loc.z = parent_loc.z + real_offset.z;

   iObjectLocationSet(Child,child_loc);
   //---------------------------------------------------------------
}

Code: [Select]
//******************************************************************
//FUNCTIONS - PARENT CHILD OFFSET - ORIENTATE CHILD TO PARENT
//******************************************************************
void ObjectParentObjectChildOffset_OrientateChild(int Parent,int Child,Vector3 Offset)
{
    //---------------------------------------------------------------
   Vector3 parent_loc;
   Vector3 real_offset;
   Vector3 child_loc;
   Quaternion parent_rot;
   
   iObjectLocation(Parent,parent_loc);
   iObjectOrientation(Parent,parent_rot);
   
   iVectorRotate(real_offset,Offset,parent_rot);
   
   child_loc.x = parent_loc.x + real_offset.x;
   child_loc.y = parent_loc.y + real_offset.y;
   child_loc.z = parent_loc.z + real_offset.z;

   iObjectLocationSet(Child,child_loc);
   iObjectOrientationSet(Child,parent_rot);
   //---------------------------------------------------------------
}



usage:

place either function below main in a script.

then you can call it in main like...


Code: [Select]
ObjectParentObjectChildOffset(OBJ_0,OBJ_22,Vector3(0.0f,1.0f,0.0f));//or whatever vector3 position you want
that will make OBJ_22 position 1 meter above it's parent OBJ_0, but you can set the vector3 to any position and the child will always
hold on to that offset.

« Last Edit: May 06, 2010, 10:20:32 PM by genetransfer »
using 3Drad 7.22

system specs:
Windows 7 Home Premium 64-bit
Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz (4 CPUs), ~3.2Ghz
8 gig ram
Geforce GTX 650 1024 MB GDDR5
DirectX 11
« Reply #12 on: May 06, 2010, 11:16:55 PM »
K, I don't get it.. I could totally change the code and make something work, but I don't see the point in deleting parts of your script. Could you modify this project showing how this script should be linked to the objects please? Maybe I could learn a bit about the organization you used in the beginning of the script...
« Reply #13 on: May 07, 2010, 12:42:39 AM »
attached a modified version of what you posted with a part that breaks away.

Edit: Press space to detatch part.

in yours you put the whole function in the main loop but it goes below the main loop and you make calls to it from the main. it'll make sence when you try the demo.
using 3Drad 7.22

system specs:
Windows 7 Home Premium 64-bit
Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz (4 CPUs), ~3.2Ghz
8 gig ram
Geforce GTX 650 1024 MB GDDR5
DirectX 11
« Reply #14 on: May 07, 2010, 08:35:07 AM »
ahhh, OK. thanks gene. I am getting better with scripting every day!
CsharpJsharp.com: the computer nerd site. Accepting suggestions!




Windows 7 on Acer Aspire 5735 laptop
Pentium Dual-Core T3200
732 MB Mobile Intel Graphics Accelerator 4500M
2GB DDR2 RAM
Pages: [1] 2