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

Register

Team Spartan Cookies & Milk Forums Garry's Mod Expression 2 v
« Previous 1 … 4 5 6 7 8 Next »
Holo orbit problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Holo orbit problem
13-06-2014, 04:33 AM,
#1
The Crowbar Overlord Offline
TSCM Member
***
Posts: 3
Threads: 1
Joined: Sep 2013
Holo orbit problem
I have a small problem I encountered while creating holograms on an E2 Chip.

The object (Cube) is orbiting around the center of another object (Sphere).
It works completely fine on the X and Y axis, but if I try to do anything on the Z axis, it always spirals out of sight and resets in it's starting position.

The code is the following:

interval(10)

Timer = Timer + 1 * 0.1
T = Timer
Count += 0.01

X1 = 0
Y1 = 0
Z1 = 0

##Orbiting Objects

X2 = 100 * cosr(Count)
Y2 = 100 * sinr(Count)
Z2 = 0

holoPos(43,holoEntity(1):pos() +vec(0,0,0) +vec(X2,Y2,Z2))

__
Is it possible to create a wobbly or tilted orbit around the Sphere?
Find
Reply
13-06-2014, 11:27 AM,
#2
pho Offline
once you go pho you never go back
***
Posts: 578
Threads: 82
Joined: Oct 2013
RE: Holo orbit problem
can you give me the entire code ?
Website Find
Reply
13-06-2014, 11:53 AM,
#3
Cobra Offline
Moderator
*****
Posts: 306
Threads: 18
Joined: Oct 2013
RE: Holo orbit problem
I did the math on my own for this:

Code:
interval(10) AnglePerTick = 1 CurTick = CurTick + 1 Radius = 100 relXPos = cos(CurTick * AnglePerTick) * Radius relZPos = sin(CurTick * AnglePerTick) * Radius holoPos(43, vec(relXPos, 0, relZPos))

You will have to make CurTick persistant in order that it works correctly. This is just some pseudo code I wrote without testing it, so maybe you will need to make some adjustements. (Did not code E2 in a long time, mostly into SF atm)

  • ASUS R.O.G. Rampage IV Black Edition
  • 2x Fury X
  • Intel Core i7 4930K OC @ 4.4GHz
  • Corsair H100i
  • Samsung SSD 850 Series 1TB
  • Samsung SSD 830 Series 512GB
  • Western Digital 512GB HDD
  • 32GB DDR3 2400MHz RAM (G.Skill TridentX)
  • Corsair 900D
Website Find
Reply
13-06-2014, 12:48 PM,
#4
The Crowbar Overlord Offline
TSCM Member
***
Posts: 3
Threads: 1
Joined: Sep 2013
RE: Holo orbit problem
Thanks, Cobra! That worked perfectly!
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


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

Powered By MyBB, © 2002-2026 MyBB Group.