DavidiiJoin Date: 2008-07-17 Post Count: 1282 |
Ok. Assuming this diagram:
Sun
[||||]
[||||]-----------------------[] Planet
[||||]
Would this work to return a CFrame 90 degrees positive to the direction between the Planet and the Sun?
while true do
local current_cframe = CFrame.new(Sun.Position - Planet.Position)
local rotation_cframe = CFrame.fromAxisAngle(Vector3.new(0, 1, 0), math.pi/2)
local final_cframe = current_cframe * rotation_cframe --This should be the unit between
--The sun and the planet + 90 degrees
wait()
end |
|
DavidiiJoin Date: 2008-07-17 Post Count: 1282 |
I need to know this because I'm trying to make centripetal motion around the sun to simulate a solar system. |
|
fugglesJoin Date: 2008-03-01 Post Count: 13937 |
I'm confused, what do want? Because you can use atan2(p1, p2) to get the angle of 2 positions if thats what you're wanting. |
|
DavidiiJoin Date: 2008-07-17 Post Count: 1282 |
I want to get an angle, add 90 degrees to it to get a perpindicular line. Ok? |
|
|
Hrmm... you could use cos and sin to move the planet around in a circle. I wouldn't know how to use a getEulerAngles function, but I should try to make one. =P
I already have plans to make it. |
|
booingJoin Date: 2009-05-04 Post Count: 6594 |
I never knew blobbyblob couldn't script. Interesting. |
|
|
|
Why don't you just take the X axis from the sun, the Y from the planet, ignore the Z, and merge it all into one CFrame value? |
|
|
aboy5643Join Date: 2010-10-08 Post Count: 5458 |
When did booing become such a bad troll lol.
@blobbyblob
OMG I used to worship you lol |
|
booingJoin Date: 2009-05-04 Post Count: 6594 |
aboy:
I'm a bad troll? Really? After everything I've taught, you still continue to try to diss me? Pathetic. I'm leaving this forum forever. |
|
devTreeJoin Date: 2012-12-26 Post Count: 2596 |
booing come bak :( |
|
AlyteJoin Date: 2011-10-24 Post Count: 10090 |
i dont really care if he trolls its just annoying cuz sometimes its like *futurama meme* "cant tell if trolling....or just stupid" |
|
aboy5643Join Date: 2010-10-08 Post Count: 5458 |
Lol yeah this is trolling. "After everything I've taught..." yeah like the fact that instead of making arguments you can show people how they were in the past. Because that's typically how I judge others in a skill, not how they currently are at it. |
|
misgav11Join Date: 2011-04-21 Post Count: 3418 |
if you want an angle then use tan(rise/run)?
math.atan((Sun.Position.Y-Planet.Position.X)/(Sun.Position.X-Planet.Position.X)) + math.pi/2 |
|
misgav11Join Date: 2011-04-21 Post Count: 3418 |
mini mistake :c
math.atan((Sun.Position.Y-Planet.Position.Y)/(Sun.Position.X-Planet.Position.X)) + math.pi/2 |
|
|
Why're you trying to help him when this thread is over five years old? |
|
misgav11Join Date: 2011-04-21 Post Count: 3418 |
WUT LOL, I JUST REALIZED. WHO THE FREAK BUMPED THIS? |
|
|
well you should also "just realize" that there was MULTIPLE replies about how booing necro bumped this...
you need to use your eyes mr. sir |
|
RubyQubeJoin Date: 2012-05-19 Post Count: 667 |
Hmm trying to figure out seems confusing but I get the idea... |
|
|
--[[This is how
you pull off a multi-line text]]-- |
|
|
"""Or if you are using python,
simply use 3 apostrophes for the multi-line text""" |
|
|
Who're you even talking to? |
|
|
Davidii. Doesn't know how to use multi-line in LUA. |
|
|
.-.
This post is from 2009 and he isn't trying to make multiple lines of text. |
|