Coding

 Reply to this postStart new topic

World Coords to Vehicle Offset

The DeLuca
post Apr 6 2013, 08:11 AM
Post #1


The New Guy!

Posts: 11
From: Missouri, US
Joined: 27-March 12



I'm needing to get world coordinates converted to a vehicle offset. Any ideas of doing so?


--------------------
Go to the top of the page
 
+Quote Post
fastman92
post Apr 6 2013, 08:54 AM
Post #2


Trained Member

Posts: 77
Joined: 25-October 10



It's easy
assuming that
0@ - world pos X
1@ - world pos Y
2@ - world pos Z

3@ - stored vehicle pos X
4@ - stored vehicle pos Y
5@ - stored vehicle pos Z
code:

CODE
0063: 0@ -= 3@ // (float)
0063: 1@ -= 4@ // (float)
0063: 2@ -= 5@ // (float)

Calculate the difference between vectors.

Result (vehicle offset X, Y, Z) are here in 0@, 1@, 2@

This post has been edited by fastman92: Apr 6 2013, 09:21 AM
Go to the top of the page
 
+Quote Post
The DeLuca
post Apr 6 2013, 09:07 AM
Post #3


The New Guy!

Posts: 11
From: Missouri, US
Joined: 27-March 12



Tried that. But I'm using this to apply a particle to a vehicle. And when doing this, the particle doesn't turn with the vehicle like it should.


--------------------
Go to the top of the page
 
+Quote Post
HeresOtis
post Apr 6 2013, 03:27 PM
Post #4


Newbie In Training

Posts: 17
Joined: 23-November 11



That's because the fade speed of the corona. You will have to use New Opcodes to do it correctly. Make it flash while fading.
Go to the top of the page
 
+Quote Post
Deji
post Apr 6 2013, 03:38 PM
Post #5


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



04D5 works just the same as 024F but I believe it draws coronas in the current frame, so you dont get the fadeout problem.


--------------------
Go to the top of the page
 
+Quote Post
The DeLuca
post Apr 6 2013, 07:06 PM
Post #6


The New Guy!

Posts: 11
From: Missouri, US
Joined: 27-March 12



I am using newopcodes. I'm getting coords from a matrix and needing to convert those coords to a vehicle offset to create it attached to a vehicle.


--------------------
Go to the top of the page
 
+Quote Post
aliceddendy
post Sep 21 2013, 07:58 AM
Post #7


The New Guy!

Posts: 2
Joined: 20-September 13



What are the codes for that?


--------------------
"Never stop dreaming." choosehottubsdirect.com reviews
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: