Sin Wave - Floating Objects?
Blitz3D Forums/Blitz3D Programming/Sin Wave - Floating Objects?
| ||
Hi all. Can someone please help me fix "Float_Objects ( )" function? I want the shapes to bob slowly up & down on a Sin() wave like Asteroids. Here's my demo: Thanks! =) ~GF |
| ||
I can't help since i only know the basics of math. Not sure i understand what you want, but if you want your meshes to float on water-like waves, there are several examples of 3d waves in the code archives... |
| ||
no. I said I want them to float slowly up & down like asteroids USING the Sin() wave function. ~GF |
| ||
Asteroids do not float up and down, they rather have a direction, a linearvelocity (translate) and an angularvelocity (rotate) |
| ||
please.. stop with all the schmuck... I just want these objects to float up and down slowly. ~GF |
| ||
Sin() and Cos() return a value beetween -1 and 1 with an angle beetween 0 and 360. So you need an "angle" for each of your object, that you increment with a speed, then use Sin() or Cos() with that angle, multiplied with the desired amplitude. Example : |
| ||
Thank you, Flanker! :) ~GF |
| ||
Nice example :) You can probably achieve the same effect by using a height# variable that you progressively increase or decrease. |