• Welcome to Dark Bit Factory & Gravity.
 

[C++][OpenGL] Sine Scroller

Started by lucastar, May 10, 2013

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

lucastar

 :updance:

I did it!!!
The method is very simple, here is the example, and later i will upload the code and an explanation.

I am very happy because in the end i did it in a home-made way.

ninogenio

wow!!  :clap: excellent work mate! K++
Challenge Trophies Won:

lucastar

Quote from: ninogenio on May 22, 2013
wow!!  :clap: excellent work mate! K++

thanks ninogenio!!

Raizor

Great stuff lucastar \o/

Looking forward to see how you did it :)
raizor

Challenge Trophies Won:

lucastar

Quote from: Raizor on May 22, 2013
Great stuff lucastar \o/

Looking forward to see how you did it :)
Thanks!!

OK, in the source is the Test() method in bmpFont.cpp class.

I will try to explain myself well (please see the attached image):

We draw the first quad, and the next one must have:
the left-top point = right-top point from the previous quad;
the left-bottom point = right bottom point from the previous quad;

then the right points = right points from the previous adding:
to the x coordinate, the size of the quad
to the y coordinate the yOffset.

The yOffset is calculated this way:
float yOffset = sin(time - x/*one of the two x point values*/ * n1 ))*n2;
n1 and n2 are float values.

Sorry for my terrible English, and if you have any questions please ask!

Canopy

good work!

if you remove the contents of framework64k\bin\v8\x86\Debug your uploaded .zip file will be a LOT smaller :)   (mainly the pdb/obj/idb/bsc taking up space)

lucastar

Quote from: Canopy on May 22, 2013
good work!

if you remove the contents of framework64k\bin\v8\x86\Debug your uploaded .zip file will be a LOT smaller :)   (mainly the pdb/obj/idb/bsc taking up space)

Ok thanks for the advice!

Raizor

Just wondered if you'd done any more work on this lucastar? :)
raizor

Challenge Trophies Won:

lucastar

That was the effect i wanted, so now I'm trying to make a color gradient to put to the letters.