Author Topic: jelly vector / dragon ball  (Read 17351 times)

0 Members and 1 Guest are viewing this topic.

Offline marlon

  • C= 64
  • **
  • Posts: 38
  • Karma: 15
    • View Profile
jelly vector / dragon ball
« on: February 22, 2012 »
Hey there!  =)

Back in the good old Melon days I used to LOVE their "Jelly Cube" and "DragonBall" in the Human Target - Amiga demo..

Now that is said.. Can anyone explain to me how they are made?


- Marlon Bodhi

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: jelly vector / dragon ball
« Reply #1 on: February 22, 2012 »
Quote
"DragonBall"
The "ball" is just a filled circle which can be scaled along the y axis (by skipping scanlines of the original circle).
The stars are  3d vectors which match the size of the circle and get the same y-scaling in 2d space.
Backfacing polygons are drawn in a different color to make the ball appear transparent.

Quote
"Jelly Cube"
A cube which is subdivided along the y-axis.
The outer edges represent a sine with changing amplitude.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: jelly vector / dragon ball
« Reply #2 on: February 23, 2012 »
It's a shame there's not a demo effects Wiki as things like this are really interesting. It would be great to have info on effects all under one roof somewhere.

K++ for the info Hellfire.
raizor

Challenge Trophies Won:

Offline marlon

  • C= 64
  • **
  • Posts: 38
  • Karma: 15
    • View Profile
Re: jelly vector / dragon ball
« Reply #3 on: February 23, 2012 »
Thank you very much.

I actually thought it was done using a geosphere and some texture mapped stars..

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: jelly vector / dragon ball
« Reply #4 on: February 23, 2012 »
I actually thought it was done using a geosphere and some texture mapped stars..
That's how you'd do it today.
Back in the days a reasonably smooth sphere-mesh would have had way too many polys, though.
Challenge Trophies Won:

Offline marlon

  • C= 64
  • **
  • Posts: 38
  • Karma: 15
    • View Profile
Re: jelly vector / dragon ball
« Reply #5 on: February 23, 2012 »
when you say subdividing that cube.. Do you mean that it is split up into a lot of cubes with the same width but a 1-pixel height!?

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: jelly vector / dragon ball
« Reply #6 on: February 23, 2012 »
Do you mean that it is split up into a lot of cubes with the same width but a 1-pixel height!?
One pixel isn't necessary, just a few segments along the y-axis are enough:

Challenge Trophies Won:

Offline marlon

  • C= 64
  • **
  • Posts: 38
  • Karma: 15
    • View Profile
Re: jelly vector / dragon ball
« Reply #7 on: February 26, 2012 »
Nice picture..   thanks alot!   =)

How do I actually rotate a (or a few) single vertex in a box consisting of many vertices..?


- Marlon Bodhi

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: jelly vector / dragon ball
« Reply #8 on: February 26, 2012 »
How do I actually rotate a (or a few) single vertex in a box consisting of many vertices..?
There's no rotation involved here.
Imagine your cube ranges from -0.5..+0.5 in X & Z and from 0.0..+1.0 in Y:

The scaling along y describes a sine.

So you just have to scale each vertex' xz according to y:
Code: [Select]
float scale; // something between 0.5 and 1.5
for (int i=0;i<numVertices;i++)
{
  float xz= sin( cubeVertex[i].y * M_PI ) * (1.0-scale) + 1.0;
  squishedVertex[i].x = cubeVertex[i].x * xz;
  squishedVertex[i].y = cubeVertex[i].y * scale;
  squishedVertex[i].z = cubeVertex[i].z * xz;
}
« Last Edit: February 29, 2012 by hellfire »
Challenge Trophies Won:

Offline marlon

  • C= 64
  • **
  • Posts: 38
  • Karma: 15
    • View Profile
Re: jelly vector / dragon ball
« Reply #9 on: February 28, 2012 »
Thanks again Hellfire!

I have now made that example.. And also used the same cube for twisting..
The jelly cube is fine with a solid color..  But with done with flatshading or smoothshading it really looks..  "Eeeeewww"   =(


Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: jelly vector / dragon ball
« Reply #10 on: February 28, 2012 »
The jelly cube is fine with a solid color..  But with done with flatshading or smoothshading it really looks..  "Eeeeewww"   =(
Have you set up proper vertex-normals?
The normals change when you modify the vertex positions.
Don't use shared vertex normals across the different sides of the cube (shade each side separately).
Challenge Trophies Won:

Offline marlon

  • C= 64
  • **
  • Posts: 38
  • Karma: 15
    • View Profile
Re: jelly vector / dragon ball
« Reply #11 on: February 28, 2012 »
I change the vertices and then i calculate a new normal for each vertex..

I have 4 vertices per segment and 9 segments..  Just like the picture you made..
So that is 36 vertices in all for that cube..

So some of the vertices are being used many times for several triangles..

I have used VertexArrays and NormalsArrays..

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: jelly vector / dragon ball
« Reply #12 on: February 28, 2012 »
Can you post an image or exe showing the problem?
Challenge Trophies Won:

Offline marlon

  • C= 64
  • **
  • Posts: 38
  • Karma: 15
    • View Profile
Re: jelly vector / dragon ball
« Reply #13 on: February 29, 2012 »
one in wireframe and one in solid and one mixed..
« Last Edit: February 29, 2012 by marlon »

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: jelly vector / dragon ball
« Reply #14 on: February 29, 2012 »
Uh, that looks really strange indeed.
According to the diagonal pattern your quads seem to be connected to different rows.
(which is probably not the case since the wireframe seems to be correct)
Where do you get the colors from?
If you don't mind sharing it, I could have a look at the source code.
Challenge Trophies Won:

Offline marlon

  • C= 64
  • **
  • Posts: 38
  • Karma: 15
    • View Profile
Re: jelly vector / dragon ball
« Reply #15 on: March 02, 2012 »
all the vertices and vertexlist are done in hand..  Just drawing it on paper and then tried to put it in VC++

i am using an example from nehe to set up the windows and opengl.. because now i rather wanted to learn some opengl than using to much power on struggling with the other things..


http://www.marlonbodhi.com/humm.avi
« Last Edit: March 03, 2012 by marlon »

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: jelly vector / dragon ball
« Reply #16 on: March 03, 2012 »
Just out of curiosity Hellfire, what did you use to put those diagrams together? They look pretty neat.
raizor

Challenge Trophies Won:

Offline marlon

  • C= 64
  • **
  • Posts: 38
  • Karma: 15
    • View Profile
Re: jelly vector / dragon ball
« Reply #17 on: March 03, 2012 »
yes..  those diagrams look very pro!   

http://www.marlonbodhi.com/lol.avi

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: jelly vector / dragon ball
« Reply #18 on: March 05, 2012 »
Just out of curiosity Hellfire, what did you use to put those diagrams together? They look pretty neat.
The first picture was a quick mock-up with 3dsmax.
The second was made with Cool Math's Graph (don't laugh: it's a math website for kids!) and some photoshop.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: jelly vector / dragon ball
« Reply #19 on: March 05, 2012 »
Hehe, very resourceful - thanks :)
raizor

Challenge Trophies Won: