Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
best way for bullet hole; is this anywere close?
Topic Started: Sep 22 2008, 11:19 PM (238 Views)
Bazza
Member Avatar
Forum God
[ *  *  *  *  *  * ]
is this the best way to get a rotx and roty for a bullet hole?

BulletTragectory script
Code:
 
MinRoty=gun.roty-(camera.Offs)
MaxRoty=gun.roty+(camera.Offs)
MinRotx=gun.rotx-(camera.Offs)
MaxRotx=gun.rotx+(camera.Offs)
{for (i=0;i<2;i+=1;) Numb[i]=random(1)}
switch(Numb[1]){
case 0: Roty=MinRoty+random(camera.Offs); break;
case 1: Roty=MaxRoty-random(camera.Offs); break;
}
switch(Numb[2]){
case 0: Rotx=MinRotx+random(camera.Offs); break;
case 1: Rotx=MaxRotx-random(camera.Offs); break;
}
BulletHole(Roty,Rotx)



BulletHole
Code:
 
Dir=CreateDirectionVector(-1,argument1,argument2)
Dist=CheckRayIntersection(all,gun.x,gun.y,gun.z,argument1,argument2)
GetRayTracingNormal(Rot)
Lati=CalculateVectorLatitude(Rot)
Longi=CalculateVectorLongitude(Rot)
//heres a part i swiped from the lazer fx example lol
CalculateVectorScalarProduct(Dir,Dir,Dist);
X=x+GetVector(Vect,1);
Y=y+GetVector(Vect,2);
Z=z+GetVector(Vect,3);
ApplyBulletHole(Lati,Longi,X,Y,Z);


ApplyBulletHole
Code:
 
ID=instance_create(argument3,argument4,BulletHole)
with (ID)
{
z=argument5;
rotx=argument1;
roty=argument2;
alarm[0]=1;
}

Edited by Bazza, Sep 24 2008, 07:01 AM.
My instinct is to hide in this barrel, like the wily fish.
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
I think I told you this before. Do not bump that fast. You did not even wait three hours. I deleted your bump.

Anyway, the best way to get rotation information for bullet hole quads is using GetRayTracingNormal(...) in combination with CalculateVectorLongitude(...) and CalculateVectorLatitude(...).
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply