Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 6 7 8 9 10 … 18 Next »
Rotating an entity with a center of rotation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
Rotating an entity with a center of rotation
03-08-2017, 09:24 PM,
#2
Veegi Offline
Marker Translator
Posts: 90
Threads: 6
Joined: Sep 2013
RE: Rotating an entity with a center of rotation
There are two ways to approach this.

In some cases, holos for example, you could make an invisible "rotator" holo, parent the object you want to rotate, and rotate the rotator holo; not sure how well this works with props and stuff though, so that leads us to the other method: rotation matrices.

You can get the location of the object you want to rotate in local coordinates relative to the rotation origin, rotate the local coordinates, and turn the rotated local coordinates back to world coordinates. Afterwards you'll also have to rotate the model, as the aforementioned process only changes it's position. To use a rotation matrix you could implement matrix operations to your code, but you can just do it in multiple steps with boring regular operators.

I'll link the Wikipedia page for rotation matrices for you to get started. Big Grin

ohai
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
Rotating an entity with a center of rotation - by Salira - 03-08-2017, 06:59 PM
RE: Rotating an entity with a center of rotation - by Veegi - 03-08-2017, 09:24 PM
RE: Rotating an entity with a center of rotation - by Kosmos - 04-08-2017, 04:01 AM
RE: Rotating an entity with a center of rotation - by Salira - 06-08-2017, 10:22 PM

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.