i made a orbiter.
but i used sin() and cos()
e2 Code:
@name Planets
@inputs
@outputs
@persist Counter Spin
@trigger all
interval(10)
if(first()){
holoCreate(1)
holoCreate(2)
holoCreate(3)
}
Spin+=2
Counter++
Sinearth = sin(Counter*1.2)
Cosearth = cos(Counter*1.2)
SinMoon = sin(Counter*10)
CosMoon = cos(Counter*10)
#Sun
Pos1 = entity():pos() + entity():up()*50
holoPos(1,Pos1)
holoModel(1,"sphere3")
holoColor(1,vec(255,255,0))
holoScale(1,vec(5,5,5))
holoMaterial(1,"debug/debugdrawflat")
#Earth
Pos2 = entity():pos() + entity():up()*50 + vec(Sinearth*100,Cosearth*100,0)
holoPos(2,Pos2 )
holoModel(2,"sphere3")
holoColor(2,vec(0,255,150))
holoScale(2,vec(1.2,1.2,1.2))
holoAng(2,ang(0,Spin,0))
holoMaterial(2,"debug/debugdrawflat")
#Moon
Pos3 = Pos2 + vec( SinMoon*15,CosMoon*15,0)
holoPos(3,Pos3)
holoModel(3,"sphere3")
holoColor(3,vec(255,255,255))
holoScale(3,vec(0.2,0.2,0.2))
holoAng(3,ang(0,Spin,0))
holoMaterial(3,"debug/debugdrawflat")
Bookmarks