I need to fix these lines in the vertex shader i guess:
[java]
texCoordAni.x = -(1.0 - ((texCoordAni.x + mod((selectedTile), (iNumTilesU))) / iNumTilesU)); ///selectedTile;
texCoordAni.y = ((-texCoordAni.y - (selectedTile / iNumTilesU)) / iNumTilesV); ///selectedTile;
[/java]
Hi! @mifth awesome ! it was very helpful. it seem it have the same error on the line 36 i change to
selectedTile += int(g_Time) * int(m_Speed);
but i have a wire effect in the sprite related to the round int, i will try to fix and i back to you if you have any clue just write me my videocard it’s an old geforce 9400m executing opengl 2.1 on mac os x 10.6.6
@juglarx it seems i fixed it. Can you test my code on your machine?
Don’t forget to make “clean and build” before running the test.
[java]
selectedTile += int(g_Time*m_Speed);
// the "1 - " bit is because otherwise it goes from right to left
texCoordAni.x = -(1.0 - float((texCoordAni.x + mod(float(selectedTile), float(iNumTilesU))) / float(iNumTilesU))); ///selectedTile;
texCoordAni.y = (-texCoordAni.y - float(selectedTile / iNumTilesU)) / float(iNumTilesV); ///selectedTile;[/java]
hi ! thanks again @mifth, in order to compile i need to change
This line
selectedTile += int(g_Time*m_Speed);
for this one
selectedTile += (int(g_Time) * int(m_Speed));
but now it seem skip same frame in the animation any clue on that? i think is for the int round… but i can’t figure out how to solve it…
AAAhhhh!!! @juglarx you need to do like this!
[java]selectedTile += int(g_Time*float(m_Speed));[/java]
Entire change will be:
[java]
selectedTile += int(g_Time*float(m_Speed));
// the "1 - " bit is because otherwise it goes from right to left
texCoordAni.x = -(1.0 - float((texCoordAni.x + mod(float(selectedTile), float(iNumTilesU))) / float(iNumTilesU))); ///selectedTile;
texCoordAni.y = (-texCoordAni.y - float(selectedTile / iNumTilesU)) / float(iNumTilesV); ///selectedTile;