Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 06 Sep 2011 01:36 PM |
Ok here. SImple formula actually: d = v * t
np = new position op = old position
np = d + op
So here:
d = velocity * time In roblox do this: distance = speed * time new position = (old position * direction) + distance |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2011 01:40 PM |
| Or do you want it the complicated way? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 06 Sep 2011 01:47 PM |
Oh okay. Gravity, gravity gravity. Let's see. *Thinks* What's roblox's gravity? And is air friction taken into account?
|
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Sep 2011 01:52 PM |
What I don't get is how gravity will be taken into account. ROblox gravity I think works this way: After a set amount of time, it falls down a set amount of distance, and the speed increases a set amount. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 06 Sep 2011 01:54 PM |
| someone told me what the gravity in roblox is (i was calculating kenetic and potential energy), but i can't remember it >:| |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2011 01:57 PM |
... Oysi, y ou said you wanted gravity to be taken into account. In order for that, I need to know roblox's gravity and then calculate the pull of it so you will have a accurate position... |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2011 01:59 PM |
would this help? http://www.roblox.com/Forum/ShowPost.aspx?PostID=47250573 |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 06 Sep 2011 02:04 PM |
d = v * t
np = new position op = old position
np = d + op
d = velocity * time In roblox do this: distance = speed * time gravityaffect = gravity * t new position = (((old position * direction) + distance) - gravityaffect)
The robloxian gravity affect is 196.2 studs/second It pulls down objects 192.6 studs every second. |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 06 Sep 2011 02:23 PM |
g = gravitational acceleration ang = launch angle v = launch velocity h = initial height
print(((v*math.cos(ang))/g)*(v*math.sin(ang)+math.sqrt((v*math.sin(ang))^2+2*g*h)
Just threw it together, unlikely it will work the first time |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 06 Sep 2011 02:24 PM |
Oops, here:
print(((v*math.cos(ang))/g)*(v*math.sin(ang)+math.sqrt((v*math.sin(ang))^2+2*g*h)))
~A revolution is born when one forgets the meaning of "impossible" |
|
|
| Report Abuse |
|
|
| |
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 06 Sep 2011 02:26 PM |
Oh...mine will only give you how far it will travel, sorry 'bout that XP
~A revolution is born when one forgets the meaning of "impossible" |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2011 02:28 PM |
That's what I thought so... Why did you use trig for no reason?
|
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 06 Sep 2011 02:31 PM |
I didn't read his post thoroughly enough, so I thought that's what he was asking.
~A revolution is born when one forgets the meaning of "impossible" |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 06 Sep 2011 02:33 PM |
Just a thought, why don't you set up a test round and record the position at various times during flight?
~A revolution is born when one forgets the meaning of "impossible" |
|
|
| Report Abuse |
|
|
blockoo
|
  |
| Joined: 08 Nov 2007 |
| Total Posts: 17202 |
|
|
| 06 Sep 2011 02:49 PM |
Ok, how about this. The X and Z velocity should remain constant throughout flight until it lands:
time = # velocity = #,#,#
print(velocity.X * time, velocity.Z * time)
Now just to figure out how to calculate the Y...
~A revolution is born when one forgets the meaning of "impossible" |
|
|
| Report Abuse |
|
|