ornithopter help
4 posters
RigidChips :: Rigid-Chips :: Tutorials
Page 1 of 1
ornithopter help
ok well this was originally posted on the ipbfree forums, but i didnt understand it then. now that i am in high school, i am starting to learn some more advance mathematical equations, and i think i will be able to understand it.
so, what was the equation again to make oscillation?
so, what was the equation again to make oscillation?
Sting Auer- Hover
- Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.
Re: ornithopter help
or... sin(asin(sin(, if you want to get excessive.
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: ornithopter help
ok i tried to use the _SIN functions. i dont know how.
Sting Auer- Hover
- Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.
Re: ornithopter help
Basically, sin(x) takes in x as an angle in radians. If you have learnt basic trigonometry, you'd know the relationship between the angles and their sine values. sin(0) = 0, sin(90) = 1, sin(180) = 0, sin(270) = -1. As such, you can increase the value of x each frame so that it keeps oscillating. Because a full circle is 360 degrees, e.g. sin(0) = sin(360), it will work just fine even when the angle exceeds 360 degrees. But for elegance's sake, personally I would reset it to zero when it reaches 360, so that it would never approach infinity.
And there's a twist: trig functions in RC (and in general) take angles in radians, which is another unit for angles. Therefore in RC, you should use
Good luck!
And there's a twist: trig functions in RC (and in general) take angles in radians, which is another unit for angles. Therefore in RC, you should use
- Code:
ANGLE = amplitude*_SIN(_TORAD(x))
Good luck!
Re: ornithopter help
ok thank you bwansy!
EDIT: wait it isnt working...
heres the code for the test. what do i do?
EDIT: wait it isnt working...
heres the code for the test. what do i do?
- Code:
// [RCD]
Val
{
ANGLE(default=0, max=360)
}
Key
{
4:ANGLE(step=2)
}
Body
{
Core() {
S:Frame(angle=90) {
S:Frame() {
S:Chip(angle=90) {
E:Chip() { }
S:Chip() { }
W:Chip() { }
N:Chip() { }
}
}
}
E:Chip(angle=ANGLE, name=wing) { }
}
}
Script
{ANGLE = 360*_SIN(_TODEG(360))}
Sting Auer- Hover
- Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.
Re: ornithopter help
Oh, as I said, x needs to be changing constantly in order for the oscillation to work. So rather than having a fixed number inside _SIN(), you need something like
I hope that helps.
- Code:
x = x+2
ANGLE = 360*_SIN(_TODEG(x))
I hope that helps.
Re: ornithopter help
ok i aded the x=x+2 and even tried x=x*2
it still doesn't work.
it still doesn't work.
Sting Auer- Hover
- Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.
Re: ornithopter help
It could be that you don't have local variables in script...
Try adding a VAL to the model, called X, with no maximum and a step of 0.
Try adding a VAL to the model, called X, with no maximum and a step of 0.
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: ornithopter help
JHaskly wrote:It could be that you don't have local variables in script...
Ah, I forgot about that. Sorry for the confusion.
Re: ornithopter help
ah ok thank you
Sting Auer- Hover
- Posts : 170
Join date : 2010-09-19
Location : Aw crap i think I'm lost.
Re: ornithopter help
Hahahaa bwansy, we're to used to Lua
JHaskly- Admin
- Posts : 235
Join date : 2010-07-16
Age : 28
Location : Brisbane
Re: ornithopter help
here is my model i made before seen this post i dint make the script
z and x are move
somtime it fails at stop
- Code:
// [RCD]
Val
{
D(default=0, min=-20, max=20, step=25)
FLAPSPEED(default=0, min=-1000000000000, max=10000000000, step=100000)
PITCH(default=0, min=-10, max=10, step=5)
ROLL(default=0, min=-20, max=20, step=10)
WINGANGLE(default=0, min=-45, max=45)
WINGS(default=0, min=-40, max=40)
X(default=0)
}
Key
{
0:PITCH(step=-4)
1:PITCH(step=4)
2:ROLL(step=-4)
3:ROLL(step=4)
4:FLAPSPEED(step=-12000), D(step=20)
5:FLAPSPEED(step=-1200), D(step=20)
}
Body
{
Core() {
N:Chip() { }
W:Frame(angle=WINGS) {
W:Trim(angle=WINGANGLE) {
W:Chip() {
S:Chip() {
S:Chip() { }
}
W:Chip() {
S:Chip() {
S:Chip() { }
}
W:Chip() {
S:Chip() {
S:Chip() { }
}
}
}
}
}
}
E:Frame(angle=WINGS) {
E:Trim(angle=-WINGANGLE) {
E:Chip() {
E:Chip() {
E:Chip() {
S:Chip() {
S:Chip() { }
}
}
S:Chip() {
S:Chip() { }
}
}
S:Chip() {
S:Chip() { }
}
}
}
}
E:Frame(angle=-WINGS) {
E:Trim(angle=WINGANGLE, color=#FF0000) {
E:Chip() {
E:Chip() {
E:Chip() {
S:Chip(color=#FF0000) {
S:Chip() { }
}
}
S:Chip() {
S:Chip() { }
}
}
S:Chip() {
S:Chip() { }
}
}
}
}
W:Frame(angle=-WINGS) {
W:Trim(angle=-WINGANGLE, color=#FF0000) {
W:Chip() {
S:Chip() {
S:Chip() { }
}
W:Chip() {
S:Chip() {
S:Chip() { }
}
W:Chip() {
S:Chip(color=#FF0000) {
S:Chip() { }
}
}
}
}
}
}
S:Chip() {
S:Chip(option=8) {
S:Chip() {
S:Chip() {
S:Chip(angle=PITCH) {
E:Chip() {
S:Chip() { }
}
W:Chip() {
S:Chip() { }
}
S:Chip() { }
}
S:RudderF(angle=ROLL, option=1) {
S:TrimF(angle=90, option=1) {
N:Chip() {
E:Chip() { }
W:Chip() { }
}
}
}
}
}
}
}
}
}
Script
{X=X+ FLAPSPEED
WINGS= D *_SIN(X)
WINGANGLE=D *_COS(X)
}
z and x are move
somtime it fails at stop
freek4ever- Tank
- Posts : 97
Join date : 2011-08-26
Age : 27
Location : nederland holand
RigidChips :: Rigid-Chips :: Tutorials
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum