Raised This Month: $ Target: $400
 0% 

Perpendicular to Surface


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KCE
Senior Member
Join Date: Jan 2005
Location: Los Angeles, CA
Old 07-14-2005 , 01:01   Perpendicular to Surface
Reply With Quote #1

This picture will explain (please excuse my l337 paint skills ) :

_____________________________________________ _____

[img]http://img306.**************/img306/6933/aoi2fu.png[/img]

Someone said I should use trace_normal, but how?
__________________

My 3D Art: http://k-c-e.deviantart.com/

[img]http://img213.**************/img213/7132/userbar152416mp2.gif[/img]
[img]http://img65.**************/img65/5606/userbar152433ie5.gif[/img]
[img]http://img223.**************/img223/7576/userbar152440yk6.gif[/img]
KCE is offline
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 07-14-2005 , 01:23  
Reply With Quote #2

lol....what paint skills you have.....

its the computer generation van goe[spelling]

lol[/offtopic]
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
Lord of Destruction
Member
Join Date: Sep 2004
Old 07-14-2005 , 08:36  
Reply With Quote #3

This is a way how to calculate it.
( I hope for you there is somehow an easier way )
Good luck implemeting it in small

I suggest you Visio ( MS Office 2003 CD3 ) for the next time

um, and v should be the normalized( or between 1 and ~50 ) 2D rocket velocity, rotated by 90°
Attached Thumbnails
Click image for larger version

Name:	aoi2fu_copy.png
Views:	283
Size:	11.2 KB
ID:	3270  
Lord of Destruction is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 07-14-2005 , 09:23  
Reply With Quote #4

Also, remember that the rocket is not always on axis with the map coordinate system.
__________________
twistedeuphoria is offline
mobytoss
Senior Member
Join Date: Jun 2004
Location: On my TS server
Old 07-14-2005 , 10:59  
Reply With Quote #5

Hmm, so you arent trying to find the perpendicular line, rather the angle of reflection line? :S
__________________
"As we know, There are known knowns. There are things we know we know. We also know There are known unknowns. That is to say We know there are some things We do not know. But there are also unknown unknowns, The ones we don't know We don't know."
mobytoss is offline
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 07-14-2005 , 11:28  
Reply With Quote #6

can that even be done with amxx
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
mobytoss
Senior Member
Join Date: Jun 2004
Location: On my TS server
Old 07-14-2005 , 11:43  
Reply With Quote #7

Yep, you'd be gobsmacked at the amount it can do ^^
__________________
"As we know, There are known knowns. There are things we know we know. We also know There are known unknowns. That is to say We know there are some things We do not know. But there are also unknown unknowns, The ones we don't know We don't know."
mobytoss is offline
Lord of Destruction
Member
Join Date: Sep 2004
Old 07-14-2005 , 12:32  
Reply With Quote #8

Actualy you just need two points on the wall with the same z-Value.
If you now trace-a-normal through these points and scale the result to the desired velocity, you're done with it. Sure it needs some 'basic' vector knowledge.
Lord of Destruction is offline
KCE
Senior Member
Join Date: Jan 2005
Location: Los Angeles, CA
Old 07-17-2005 , 21:30  
Reply With Quote #9

Ok I know how to calculate the velocity in that direction. Now, I need to sort of randomize the velocity in that direction. I want to "spray" a couple of ents in that direction. This is what I have so far, but it only works on certain surfaces ( like only the side walls and ceiling ). Basically it's releasing a bunch of clusters that explode. ptr is the initial missile, and when it explodes it removes ptr and spawns a bunch of smaller explosive clusters.

Code:
new Float:vVel[3] entity_get_vector(ptr, EV_VEC_velocity, vVel) new Float:oMissile[3] entity_get_vector(ptr, EV_VEC_origin, oMissile) new Float:oFar[3] oFar[0] = oMissile[0] + (vVel[0] * 8192.0) oFar[1] = oMissile[1] + (vVel[1] * 8192.0) oFar[2] = oMissile[2] + (vVel[2] * 8192.0) //assumes tracemissile(eIgnoredEnt, Float:TestFrom[3], Float:TestTo[3], Float:Returned[3]) new Float:oRetNormal[3] trace_normal(ptr, oMissile, oFar, oRetNormal) //must remove before creating so they dont explode remove_entity( ptr )    new Float:aNormal[3] //now convert the velocity in that direction to an angle vector_to_angle(oRetNormal, aNormal) //This will launch the specified number of clusters for (new i = 0; i < nclusters ; i++) {     new Float:aRand[3]     aRand[0] = random_float(aNormal[0] - 90.0 , aNormal[0] + 90.0 )             aRand[1] = random_float(aNormal[1] - 90.0 , aNormal[1] + 90.0 )                 new Float:vShrapnel[3], Float:aShrapnel[3]         aShrapnel[0] = aNormal[0] + aRand[0]     aShrapnel[1] = aNormal[1] + aRand[1]     aShrapnel[2] = aNormal[2]         //convert the angle back to a vector     angle_vector(aShrapnel, 1, vShrapnel)         new Float:fRandVel = random_float(0, get_cvar_float("shrapnel_maxvelocity"))         vShrapnel[0] *= fRandVel     vShrapnel[1] *= fRandVel     vShrapnel[2] *= fRandVel         //END VELOCITY     //...         entity_set_vector( Shrapnel, EV_VEC_velocity, vShrapnel )
__________________

My 3D Art: http://k-c-e.deviantart.com/

[img]http://img213.**************/img213/7132/userbar152416mp2.gif[/img]
[img]http://img65.**************/img65/5606/userbar152433ie5.gif[/img]
[img]http://img223.**************/img223/7576/userbar152440yk6.gif[/img]
KCE is offline
KCE
Senior Member
Join Date: Jan 2005
Location: Los Angeles, CA
Old 07-22-2005 , 22:22  
Reply With Quote #10

Bump. Anyone?
__________________

My 3D Art: http://k-c-e.deviantart.com/

[img]http://img213.**************/img213/7132/userbar152416mp2.gif[/img]
[img]http://img65.**************/img65/5606/userbar152433ie5.gif[/img]
[img]http://img223.**************/img223/7576/userbar152440yk6.gif[/img]
KCE is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode