Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > CopperCube > Programming and Scripting
Bounce and Move
Author Text

serge
Registered User
Quote
2022-07-17 20:42:26

Hello everyone,

I want to know if anyone can assist making a javascript for Bounce and move effect.

For example similar to the Helix jump https://youtu.be/mJ7-JK_5_uI

Using ccbSetPhysicsVelocity; The sphere object will bounce from ccbGetSceneNodeFromName or a folder of scene node.
Also changing the rotation of the bounce which will effect walls and floors. In attributes property create how many bounce you want the sphere object to make such as 1 bounce, 2, bounce or unlimited bounce. Also in attribute property change the speed of the bounce. Create a check list for effect wall or floor. In every bounce the scene node move forward in position.

This can be helpful for sport purpose or throwing a rock in a lake.


serge
Registered User
Quote
2022-07-17 20:45:49

Also in attribute property change the distance of the bounce


DouweDabbe
Guest
Quote
2022-07-18 10:24:48

does the ball have compression at each bounce ?


DouweDabbe
Guest
Quote
2022-07-18 11:34:17

use a parabol function: y = A*X*X + B*X + C

you want parabol with a top so:
C = positive
A = negative and
B = negative

what distance do you want to cover in all that bouncing?
oke say the distance = 10
then that is covered in 2 leaps and 3 bounces
(Bounce = touch ground)
distance and height of each leap is related to each other and
unequal, becoming smaller, easiest related by pythagoras formula =
hypothenuse * hypothenuse = leapdist * leapdist + leapheight * leapheight.

So the 2 unequal leap distance (but together = 10) on the ground
are related by some kind of sizing sequence.
you could use fibunacci formula for dividing the travel distance 10 into 2 parts.
Fibunacci sequence is 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 etc
Only two steps needed, no zero or same values allowed.
so division is 1*X and 2 *X = 10

so first leap is 6.67 far and 13.34 high and
second leap is 3.33 far and 6.67 high

formula for the first parabola is then
heigth = -6.67 * X * X -6.67 * X + 13.347
that is when the top was reached at the start point,
but that is not the case,
we reach the top at half the leapdistance travelled
so we move formula to the right
formula for the first parabola is then
heigth = -6.67 * X * X + 6.67 * X + 13.347

and for the second parabola leap formula becomes similar:
heigth = -3.33 * X * X + 3.33 * X + 6.67

my solution will begin with this.
What do you think ?
will this work, can it be simplified ?


serge
Registered User
Quote
2022-07-18 13:35:25

It came be simplified


DouweDabbe
Guest
Quote
2022-07-18 17:21:15

use this action as template: Drag 3D Object

put functions that change position of ball into dragging function.

simpler solution:
can also do in blender but without the controls:
height of jump,
distance of jump,
number of jumps.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact