Affiliates
Game maker Top sites MMG Top Sites Magic Man Games Quite Epic! Goldy's Gaming Programming

Donate To Gm3d Through PayPal
 

 point_direction_3d, find the zdirection between 2 3D points
brett14
Posted: Nov 2 2009, 07:58 PM


Major Contributor
Group Icon

Group: Global Moderator
Posts: 517
Member No.: 3
Joined: Mar 18 2009



Returns the zdirection between two 3D points (In degrees). This is now tested, credit is optional.
CODE
/*
[X1,Y1,Z1,X2,Y2,Z2] RETURNS IN RADIANS
*/
return arctan2(argument5-argument2,point_distance(argument0,argument1,argument3,argument4));


This post has been edited by brett14 on Jul 22 2010, 04:35 PM
Top
Goldy
Posted: Nov 3 2009, 08:37 AM



Group Icon

Group: Basic Moderator
Posts: 325
Member No.: 30
Joined: Jul 7 2009



that didnt work. I think i missed the z control for the first math part. i'll add that when i get home
Top
brett14
Posted: Nov 4 2009, 06:00 PM


Major Contributor
Group Icon

Group: Global Moderator
Posts: 517
Member No.: 3
Joined: Mar 18 2009



I'll make another, but check it this time. I'll upload it here later
Top
Goldy
Posted: Nov 29 2009, 04:11 AM



Group Icon

Group: Basic Moderator
Posts: 325
Member No.: 30
Joined: Jul 7 2009



3d point direction script found, thanx to icuurd for his explanation on the gmc forums. ill post link when im on computer.

point_direction_3d(xfrom,yfrom,zfrom,xto,yto,zto)
CODE
d3d_transform_add_rotation_y(point_direction(point_distance(argument0,argument1,argument3,argument4),argument5,0,argument2)+90)
d3d_transform_add_rotation_z(point_direction(argument0,argument1,argument3,argument4)-180)
Top
Goldy
  Posted: Nov 30 2009, 08:00 PM



Group Icon

Group: Basic Moderator
Posts: 325
Member No.: 30
Joined: Jul 7 2009



thanx brett to move it here.

This post has been edited by Goldy on Nov 30 2009, 08:06 PM
Top
Goldy
Posted: Mar 27 2010, 01:11 AM



Group Icon

Group: Basic Moderator
Posts: 325
Member No.: 30
Joined: Jul 7 2009



[Edited by: Brett14]
fixed in top post.

This post has been edited by brett14 on Jun 19 2010, 03:52 PM
Top
brett14
Posted: Mar 28 2010, 01:38 AM


Major Contributor
Group Icon

Group: Global Moderator
Posts: 517
Member No.: 3
Joined: Mar 18 2009



How are you using it, like show me the code your using, I used it in my game and it worked fine
Top
Goldy
Posted: May 26 2010, 08:17 PM



Group Icon

Group: Basic Moderator
Posts: 325
Member No.: 30
Joined: Jul 7 2009



Late Reply

I used it as d3d_point_direction(x,y,z,target.x,target.y,target.z). I typed the codes from this phone since i had no connection to the com. I may have a typo in it. I'll type it again, and will look over it.
Top
brett14
Posted: Jun 19 2010, 03:51 PM


Major Contributor
Group Icon

Group: Global Moderator
Posts: 517
Member No.: 3
Joined: Mar 18 2009



fixed completely, apparently I was using it wrong before.

This post has been edited by brett14 on Jun 19 2010, 03:52 PM
Top
brett14
Posted: Jul 22 2010, 04:36 PM


Major Contributor
Group Icon

Group: Global Moderator
Posts: 517
Member No.: 3
Joined: Mar 18 2009



Made more efficient
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | 3d Scripts | Next Newest »


Topic Options


Member Legend: Admin - Global Moderator- Baisc Moderator- Gold Member - Member



Hosted for free by InvisionFree (Terms of Use: Updated 2/10/2010) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Page creation time: 0.0222 seconds | Archive