generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

[ Content Deleted ]

Previous Thread :: Next Thread 
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
09 Apr 2012 01:23 PM
[ Content Deleted ]
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
09 Apr 2012 02:03 PM
[ Content Deleted ]
Report Abuse
Valone is not online. Valone
Joined: 08 Feb 2012
Total Posts: 4371
09 Apr 2012 02:10 PM
This is motion interpolation, no?
I'd personally, for the same reasons use the second one, the first is a little unclear on quite how it works. But the second one I understand.
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
09 Apr 2012 03:33 PM
You can simplify `getUpVector`:

    function getUpVector(frame)
        return frame:vectorToWorldSpace(Vector3.new(0, 1, 0))
    end

Also, `getRotation` looks suspiciously like an implementation of `CFrame.ToEulerAngles()`...
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
09 Apr 2012 03:35 PM
And I'm pretty sure that:

    CFrame.Angles(0, cy, 0) * CFrame.Angles(cx, 0, 0) * CFrame.Angles(0, 0, cz)

Is the definition of:

    CFrame.Angles(cx, cy, cz)

The rotations are applied in the order YXZ, not in argument order.
Report Abuse
manatee20 is not online. manatee20
Joined: 07 Apr 2010
Total Posts: 111
09 Apr 2012 07:23 PM
LOL NERDS
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
10 Apr 2012 07:51 AM
But oyusi, i think using angles has the problem that it will not go the straightest path on the surface of the magical rotation sphere.

Slerp fixes that.

What we should use, is quaternions, but having tried to learn them i dont think we are awesome enough to figure out how they work. They would go the straightest path (i believe....) and at a constant speed (if we use slerp or something)


Maybe we can just copypasta c++ code and translate to lua and add trigonometry until it works.
Report Abuse
Valone is not online. Valone
Joined: 08 Feb 2012
Total Posts: 4371
10 Apr 2012 09:11 AM
My code can position them perfectly, but just not rotate :/
@Radio, not quite sure if that's what you meant, but maybe it'd help.

☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☜☆☞▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞
-Valone 32nd Empress of Unit 32. Join; http://www.roblox.com/My/Groups.aspx?gid=520434
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
10 Apr 2012 09:27 AM
It meant that using euler angles will make the cframe rotate at a constant rate, and will work properly for a rotation around a single axis, but i think if the rotation is more complex, it will not rotate it in a straight line (and i think not even at constant velocity anymore)


Or did it rotate in a straight line... cant remember...
Report Abuse
Valone is not online. Valone
Joined: 08 Feb 2012
Total Posts: 4371
10 Apr 2012 09:29 AM
Ahaa, yes, this is what I produced, makes sense now.

function moveBetweenPoint(A,B)
Frames = 30
local x0, y0, z0 = A:toEulerAnglesXYZ()
local x1, y1, z1 = B:toEulerAnglesXYZ()
local X, Y, Z = -(A.p.X-B.p.X)/Frames, -(A.p.Y-B.p.Y)/Frames, -(A.p.Z-B.p.Z)/Frames
local CX, CY, CZ = -(x0-x1)/Frames, -(y0-y1)/Frames, -(z0-z1)/Frames
for i = 1,Frames do
Fram = CFrame.fromEulerAnglesXYZ(CX*i,CY*i,CZ*i)
Vec = Vector3.new(X*i,Y*i,Z*i)
Cam.CoordinateFrame = A*Fram+Vec
Cam:SetRoll(math.abs(CZ*i))
wait()
end
end

Cam = game.Workspace.CurrentCamera

function runScene(Track)
Cam.CameraType = Enum.CameraType.Scriptable
for i = 1,#Track:GetChildren()-1 do
moveBetweenPoint(Track[tostring(i)].CFrame,Track[tostring(i+1)].CFrame)
end
Cam.CameraType = Enum.CameraType.Custom
end

runScene(game.Workspace.TrackB)

Perfect rotation upon the Y, but not the X and Z.

☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☜☆☞▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞
-Valone 32nd Empress of Unit 32. Join; http://www.roblox.com/My/Groups.aspx?gid=520434
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
10 Apr 2012 09:46 AM
Though that could be just because the values toEulerAngles gives you might be weird like -180,180,0 because theres multiple ways to represent a rotation. So you cant really trust it. Thats why you use vectors.
Report Abuse
Candymaniac is not online. Candymaniac
Joined: 08 Oct 2009
Total Posts: 8985
10 Apr 2012 09:47 AM
Oh wow, thanks oysi! I really wanted a weld-rotation interpolation... as I have no idea of trigonometry. I only have a position interpolation, but not a rotation one.

"Knowledge talks, wisdom listens."
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
10 Apr 2012 10:16 AM
[ Content Deleted ]
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
10 Apr 2012 03:47 PM
[ Content Deleted ]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image