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
 

Re: Open-source radar example

Previous Thread :: Next Thread 
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
18 Aug 2016 10:42 PM
https://www.roblox.com/Open-source-radar-item?id=483393341

Credit goes to some free models I examined + a video on youtube.


-R.B. Box (Regalius Boxikins Box)
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
18 Aug 2016 10:50 PM
thats what, just like, toObjectSpace?


$.post('http://Spam',{})
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
18 Aug 2016 10:51 PM
my b

vectorToObjectSpace


$.post('http://Spam',{})
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
18 Aug 2016 11:05 PM
@Isosta

I don't know what that is, I learned from some free models and a few tutorials. I haven't taken trig yet.


-R.B. Box (Regalius Boxikins Box)
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
18 Aug 2016 11:20 PM
vectorToObjectSpace is really simple, you give it a Vector3 and it returns a rotated Vector3. An example makes this really clear:

Say I have some part and I rotate it 90 degrees along the y-axis (so the CFrame's "right" direction is now the world's forward direction.

The object-space of "right" will always be (1, 0, 0)
But in this case, the world-space would be (0, 0, -1) as it's now facing the world direction.

What vectorToObjectSpace will do is convert the bottom one to the top, that is you give it a Vector3 in world-space and returns the rotated object-space equiv.

local cf = CFrame.Angles(0, math.pi/2, 0) -- 90 degree rotation
local objRight = Vector3.new(1, 0, 0)
local worldRight = cf:vectorToWorldSpace(Vector3.new(1, 0, 0))
local objRightFromWorldRight = cf:vectorToObjectSpace(worldRight)

objRight == objRightFromWorldRight == Vector3.new(1, 0, 0)
and worldRight == Vector3.new(0, 0, -1)

Essentially, the "worldRight" is the actual direction of the "right direction" of the CFrame, whereas "objRight" is the direction relative to the orientation of the CFrame.
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
18 Aug 2016 11:21 PM
as it's now facing the world's forward** (-z)
Report Abuse
RemasteredBox is not online. RemasteredBox
Joined: 19 Jun 2016
Total Posts: 2140
18 Aug 2016 11:25 PM
I don't understand, can you try and make it simple :/


-R.B. Box (Regalius Boxikins Box)
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
18 Aug 2016 11:27 PM
The `right` direction is always (1, 0, 0) in object-space, but depending on how the CFrame is rotated it won't necessarily be (1, 0, 0) in world-space.
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
18 Aug 2016 11:46 PM
world space explanation:

http://prntscr.com/c7l7zj


The green line being the direction from partA to partB, and the black arrow being the lookVector of partA. No matter what the rotation of partA, the world space of partB never changes. the objectSpace, however, is based completely on the position and rotation of PartA.



toObjectSpace == CFrame:inverse() * cf
toWorldSpace == CFrame * cf


$.post('http://Spam',{})
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