Author Topic: [C++][OpenGL] Sine Scroller  (Read 23371 times)

0 Members and 1 Guest are viewing this topic.

Offline lucastar

  • C= 64
  • **
  • Posts: 50
  • Karma: 5
    • View Profile
Re: [C++][OpenGL] Sine Scroller
« Reply #40 on: May 22, 2013 »
 :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.

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: [C++][OpenGL] Sine Scroller
« Reply #41 on: May 22, 2013 »
wow!!  :clap: excellent work mate! K++
Challenge Trophies Won:

Offline lucastar

  • C= 64
  • **
  • Posts: 50
  • Karma: 5
    • View Profile
Re: [C++][OpenGL] Sine Scroller
« Reply #42 on: May 22, 2013 »
wow!!  :clap: excellent work mate! K++

thanks ninogenio!!

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: [C++][OpenGL] Sine Scroller
« Reply #43 on: May 22, 2013 »
Great stuff lucastar \o/

Looking forward to see how you did it :)
raizor

Challenge Trophies Won:

Offline lucastar

  • C= 64
  • **
  • Posts: 50
  • Karma: 5
    • View Profile
Re: [C++][OpenGL] Sine Scroller
« Reply #44 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!

Offline Canopy

  • Atari ST
  • ***
  • Posts: 208
  • Karma: 20
    • View Profile
Re: [C++][OpenGL] Sine Scroller
« Reply #45 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)

Offline lucastar

  • C= 64
  • **
  • Posts: 50
  • Karma: 5
    • View Profile
Re: [C++][OpenGL] Sine Scroller
« Reply #46 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!

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: [C++][OpenGL] Sine Scroller
« Reply #47 on: May 30, 2013 »
Just wondered if you'd done any more work on this lucastar? :)
raizor

Challenge Trophies Won:

Offline lucastar

  • C= 64
  • **
  • Posts: 50
  • Karma: 5
    • View Profile
Re: [C++][OpenGL] Sine Scroller
« Reply #48 on: June 01, 2013 »
That was the effect i wanted, so now I'm trying to make a color gradient to put to the letters.