38 posts
• Page **4** of **4** • 1, 2, 3, **4**

How do you set an instance variable to <varies>. I sorta get how it comes to that, but what circumstances result in <varies> being displayed in the properties bar? Like, if I edited the initial value, how do I get it back to <varies>?

I'm seeking Narnia. Who wants to come with me! Aslan is on the move!

**Posts:**770**Reputation:**14,584

B

132
S

22
G

8
set x to (2*t^3-3*t^2+1)*p(n).x + (t^3-2*t^2+t)*(p(n+1).x-p(n-1).x)/2 + (-2*t^3+3*t^2)*p(n+1).x + (t^3-t^2)*(p(n+2).x-p(n).x)/2

set Y to (2*t^3-3*t^2+1)*p(n).y + (t^3-2*t^2+t)*(p(n+1).y-p(n-1).y)/2 + (-2*t^3+3*t^2)*p(n+1).y + (t^3-t^2)*(p(n+2).y-p(n).y)/2

it must be written by Albert Einstein !

set Y to (2*t^3-3*t^2+1)*p(n).y + (t^3-2*t^2+t)*(p(n+1).y-p(n-1).y)/2 + (-2*t^3+3*t^2)*p(n+1).y + (t^3-t^2)*(p(n+2).y-p(n).y)/2

it must be written by Albert Einstein !

**Posts:**192**Reputation:**1,514

B

15
S

5
R0J0hound wrote:Here is a way to do a spline though waypoints:

http://dl.dropbox.com/u/5426011/example ... llrom.capx

A plugin could be made to hide the formula, but there isn't a way to make an in IDE node editor at this time.

Is it okay if I ask how you came up with the original spline? Is there a concept you followed to help you come up with the math inside of the 'Set position' action? I ask because I would really like direction in improving my own programming skills - of which I have none.

Edit: Lol, I didn't realize the actual name of the capx was the hint I needed.

Edit2: For anyone, like me, that couldn't get the array version working properly, you need to replace p.Count with Array.Width and (n-1) % Array.Width with n > 0 ? (n-1) % Array.Width : Array.Width-1, since when n = 0, you get -1, and I don't know how using -1 as an index affects arrays.

**Posts:**23**Reputation:**1,283

B

20
S

5
**Posts:**5,157**Reputation:**63,450

B

89
S

30
G

95
Egyptoon wrote:set x to (2*t^3-3*t^2+1)*p(n).x + (t^3-2*t^2+t)*(p(n+1).x-p(n-1).x)/2 + (-2*t^3+3*t^2)*p(n+1).x + (t^3-t^2)*(p(n+2).x-p(n).x)/2

set Y to (2*t^3-3*t^2+1)*p(n).y + (t^3-2*t^2+t)*(p(n+1).y-p(n-1).y)/2 + (-2*t^3+3*t^2)*p(n+1).y + (t^3-t^2)*(p(n+2).y-p(n).y)/2

it must be written by Albert Einstein !

I was trying to understand and know where this came from and then I find it.

in this PDF there is a small explanation on how to get those positions from X and Y: http://algorithmist.net/docs/catmullrom.pdf

(it is formula number [7] in the PDF)

now I have to understand everything.

**Posts:**214**Reputation:**39,877

B

60
S

32
G

69
Using the @R0J0hound code for CatmullRom's curves, I made an Hermite Curve example in C2..

Well, I do not know if it is useful in games, but for studies purposes it will help.

In the example there are 3 points P0, P1 and P2.

P'0, P'1 and P'2 are points that defines vectors related to the points P0, P1 and P2, respectivelly. CatmullRom curves are more easy to manipulate because defines the vectors in an implicit way.

if someone creates a P3 point, needs to create a P'3 point and match then with same variable VarPosicao=3.

here is the link for people that wanna play with Hermite Curves:

- https://drive.google.com/open?id=0B5xew ... zl2a0Fmdk0

Well, I do not know if it is useful in games, but for studies purposes it will help.

In the example there are 3 points P0, P1 and P2.

P'0, P'1 and P'2 are points that defines vectors related to the points P0, P1 and P2, respectivelly. CatmullRom curves are more easy to manipulate because defines the vectors in an implicit way.

if someone creates a P3 point, needs to create a P'3 point and match then with same variable VarPosicao=3.

here is the link for people that wanna play with Hermite Curves:

- https://drive.google.com/open?id=0B5xew ... zl2a0Fmdk0

**Posts:**214**Reputation:**39,877

B

60
S

32
G

69
38 posts
• Page **4** of **4** • 1, 2, 3, **4**

## Who is online |

Users browsing this forum: No registered users and 4 guests |