Author Topic: How to achive this morphing sphere  (Read 14547 times)

0 Members and 1 Guest are viewing this topic.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: How to achive this morphing sphere
« Reply #20 on: January 11, 2014 »
I'll add a few more options to mine and tidy the code up to make it clearer.
You are our 9001st visitor.
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: How to achive this morphing sphere
« Reply #21 on: January 11, 2014 »
@ck that would be awesome mate!

@ryt there is two plasma versions from me the wireframe one is a little easyer too see. i was just demonstrating how it could be done there is lots of tuning options like which plasma you code. if its seamless or not. and also where in the euler transforms you add the rgb components. there is three different places that all give different effects one on the raw vertex data before any tranforms take place. two is on the rotated verts before perspective and three is on the verts after perspective so its fully tuneable.

dont get me wrong though combatking's way is better .its more controlable but i thought it would be nice too fully explore all options.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: How to achive this morphing sphere
« Reply #22 on: January 12, 2014 »
I've added some extra controls to make testing different settings a bit easier.

The code still needs to be tidied up though.
You are our 9001st visitor.
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: How to achive this morphing sphere
« Reply #23 on: January 12, 2014 »
what a difference ck!

that looks really really cool. i know it would be a lot too code but i think it would look awesome if there was a ground plane and the ball had an indefinite bounce motion with the jelly animation happening mostly on impact. the ball would have too be scaled down though.

i used too watch the 3d ball demo on our ps2 yabasic demo disc and always wished it would squash on impact with the floor.
Challenge Trophies Won:

Offline ryt

  • ZX 81
  • *
  • Posts: 10
  • Karma: 1
    • View Profile
Re: How to achive this morphing sphere
« Reply #24 on: January 12, 2014 »
I just saw your wireframe demo ninogenio. It looks really good. Now with wireframe its really easy to see it.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: How to achive this morphing sphere
« Reply #25 on: January 12, 2014 »
That would be interesting - I'll have to research how to to that, but this isn't far off.
You are our 9001st visitor.
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: How to achive this morphing sphere
« Reply #26 on: January 13, 2014 »
@ryt thanks man.

but yours and combatkings idea are better i would say. in fact i dont know if you have noticed but ck uploaded a new wireframe version with loads of options and in some cases his sphere looks really really close too the demo you first posted!

:cheers:

@ck if you do decide too give the bouncing ball thing a little go. i would like too see that.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: How to achive this morphing sphere
« Reply #27 on: January 13, 2014 »
I'll have a look at it, but my physics skills aren't that good yet. I'll keep practising.
You are our 9001st visitor.
Challenge Trophies Won:

Offline ryt

  • ZX 81
  • *
  • Posts: 10
  • Karma: 1
    • View Profile
Re: How to achive this morphing sphere
« Reply #28 on: January 13, 2014 »
I gave a look at the source of your code combatking0. I don't understand all of it yet. I assume the major part of waves is on line 77, 78, 79 and 84, 85, 86. I see there is a sin function but I don't know what are you trying to achieve. Before that on lines 70 and 73 you distribute current point to next points in array so you form the wave. I think this is used as main wave around sphere.
Also in freqAdjust function you set the speed on lines 104 and 105 which are later used on lines 77 and 84. I assune you use it as some kind of phase in sin function instead of time.
If it is not too hard could this be written in math form ? Maybe it will be a little easier to understand.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: How to achive this morphing sphere
« Reply #29 on: January 13, 2014 »
Lines 76 and 83 are looking at the checkboxes to see if they are active. If they are, lines 77 and 84 add small numbers to the wave angles, in this case the pole-to-pole wave (pWave) or the radial wave (rWave).

Lines 78 and 85 check to make sure the wave values are between -pi and pi.
Lines 79 and 86 then convert the wave angles into wave heights and insert them into the first entry of each array.

The freqAdjust function controls how fast the waves are generated, their amplitude and the x-axis rotation of the sphere.
Lines 102 and 103 take the values of the Frequency select drop-down lists.
Lines 104 and 105 convert these values into the small numbers which are added to the wave values on lines 77 and 84.
Lines 106 and 107 read the Amplitude select drop-down lists. These values are applied on line 161.
Line 108 reads the Tumble select drop down list to control the direction in which the x-axis rotation is applied.

Please let me know if this has cleared up the confusion or not.
You are our 9001st visitor.
Challenge Trophies Won:

Offline ryt

  • ZX 81
  • *
  • Posts: 10
  • Karma: 1
    • View Profile
Re: How to achive this morphing sphere
« Reply #30 on: January 16, 2014 »
I am really busy these days so I haven't looked at any code. When I find some time I will try to understand it and implement it.

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: How to achive this morphing sphere
« Reply #31 on: January 16, 2014 »
That's understandable. I'm a bit behind on a couple of non-coding projects too.
You are our 9001st visitor.
Challenge Trophies Won:

Offline emook

  • C= 64
  • **
  • Posts: 94
  • Karma: 12
    • View Profile
Re: How to achive this morphing sphere
« Reply #32 on: January 24, 2014 »
Very nice stuff ++K's

----

R Tape loading error, 0:1