• Welcome to Dark Bit Factory & Gravity.
 

jelly vector / dragon ball

Started by marlon, February 22, 2012

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

marlon

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

hellfire

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:

Raizor

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:

marlon

Thank you very much.

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

hellfire

Quote from: marlon on February 23, 2012I 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:

marlon

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!?

hellfire

Quote from: marlon on February 23, 2012Do 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:

marlon

Nice picture..   thanks alot!   =)

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


- Marlon Bodhi

hellfire

#8
Quote from: marlon on February 26, 2012How 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:

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;
}

Challenge Trophies Won:

marlon

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"   =(


hellfire

Quote from: marlon 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:

marlon

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..

hellfire

Can you post an image or exe showing the problem?
Challenge Trophies Won:

marlon

#13
one in wireframe and one in solid and one mixed..

hellfire

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:

marlon

#15
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

Raizor

Just out of curiosity Hellfire, what did you use to put those diagrams together? They look pretty neat.
raizor

Challenge Trophies Won:

marlon


hellfire

Quote from: Raizor on March 03, 2012Just 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:

Raizor

Hehe, very resourceful - thanks :)
raizor

Challenge Trophies Won: