TriBase?? Gibt es da etwa ein Trident Projekt, dass ohne unseres Wissens an den Markt gegangen ist?
// Vertexformat und Titelbildtextur setzen, Z-Buffer aus D3D.SetFVF(STitleVertex::dwFVF); D3D.SetTexture(0, m_pTitle); D3D.SetRS(D3DRS_ZENABLE, D3DZB_FALSE); // Die vier Vertizes des Titelbilds erstellen (Rechteck) // Links unten aVertex[0].vPosition = tbVector3(0.0f, D3D.GetScreenSize().y, 0.5f); aVertex[0].fRHW = 1.0f; aVertex[0].Color = tbColor(1.0f, 0.8f, 0.8f); aVertex[0].vTex0 = tbVector2(0.0f, 1.0f); // Links oben aVertex[1].vPosition = tbVector3(0.0f, 0.0f, 0.0f); aVertex[1].fRHW = 1.0f; aVertex[1].Color = tbColor(0.8f, 1.0f, 0.8f); aVertex[1].vTex0 = tbVector2(0.0f, 0.0f); // Rechts unten aVertex[2].vPosition = tbVector3(D3D.GetScreenSize().x, D3D.GetScreenSize().y, 0.5f); aVertex[2].fRHW = 1.0f; aVertex[2].Color = tbColor(0.8f, 0.8f, 1.0f); aVertex[2].vTex0 = tbVector2(1.0f, 1.0f); // Rechts oben aVertex[3].vPosition = tbVector3(D3D.GetScreenSize().x, 0.0f, 0.5f); aVertex[3].fRHW = 1.0f; aVertex[3].Color = tbColor(1.0f, 1.0f, 0.8f); aVertex[3].vTex0 = tbVector2(1.0f, 0.0f);//mein Teil // Texturkoordinaten rechteckig verschieben //funktioniert nicht! => Wieso? //sin(x) verhält sich unerwartet //Zuweisung zu x/y-Koordinate ergibt nicht den erwarteten Effekt if((sin(g_pBreakanoid->m_fTime)>0) && (cos(g_pBreakanoid->m_fTime )>0)) // sin(x) positiv&steigend und cos(x) positiv&fallend // = 0 bis pi/2 { for(DWORD dwVertex = 0; dwVertex < 4; dwVertex++) { aVertex[dwVertex].vTex0.x += 0.05f * sin(g_pBreakanoid->m_fTime); //Bewegung nach rechts = x nimmt zu //y bleibt unverändert } } if((sin(g_pBreakanoid->m_fTime)>0) && (cos(g_pBreakanoid->m_fTime)<0)) //sin(x) positiv&fallend und cos(x) negativ&fallend // = pi/2 bis pi { for(DWORD dwVertex = 0; dwVertex < 4; dwVertex++) { aVertex[dwVertex].vTex0.x += (0.05f * 1); //maximale Bewegung nach rechts aVertex[dwVertex].vTex0.y += 0.05f - (0.05f * sin(g_pBreakanoid->m_fTime)); //Bewegung nach unten = y nimmt zu } } if((sin(g_pBreakanoid->m_fTime)<0) && (cos(g_pBreakanoid->m_fTime)<0)) //sin(x) negativ&fallend und cos(x) negativ&steigend // = pi bis 3pi/2 { for(DWORD dwVertex = 0; dwVertex < 4; dwVertex++) { aVertex[dwVertex].vTex0.x += 0.05f * sin(g_pBreakanoid->m_fTime); //Bewegung nach links = x nimmt ab aVertex[dwVertex].vTex0.y += (0.05f * 1); //maximale Bewegung nach unten } } if((sin(g_pBreakanoid->m_fTime)<0) && (cos(g_pBreakanoid->m_fTime)>0)) //sin(x) negativ&steigend und cos(x) positiv&steigend // 3pi/2 bis 2pi { for(DWORD dwVertex = 0; dwVertex < 4; dwVertex++) { //x bleibt unverändert aVertex[dwVertex].vTex0.y += 0.05f - (0.05f * sin(g_pBreakanoid->m_fTime)); //Bewegung nach oben = y nimmt ab } }
Dumme Frage, schaust du die Z-Achse in der richtigen Richtung runter ? Dann wäre ja die X-Achse gespiegelt.
if(m_iCursor == iEntry) vPosition.x += 0.05f * sinf(g_pBreakanoid->m_fTime);
//im Uhrzeigersinn if((sin(g_pBreakanoid->m_fTime)>0) && (cos(g_pBreakanoid->m_fTime )>0)) // sin(x) positiv&steigend und cos(x) positiv&fallend // = 0 bis pi/2 { for(DWORD dwVertex = 0; dwVertex < 4; dwVertex++) { aVertex[dwVertex].vTex0.x += -0.05f * sinf(g_pBreakanoid->m_fTime); //Bewegung nach rechts = x nimmt zu //y bleibt unverändert } } if((sin(g_pBreakanoid->m_fTime)>0) && (cos(g_pBreakanoid->m_fTime)<0)) //sin(x) positiv&fallend und cos(x) negativ&fallend // = pi/2 bis pi { for(DWORD dwVertex = 0; dwVertex < 4; dwVertex++) { aVertex[dwVertex].vTex0.x += -0.05f; //maximale Bewegung nach rechts aVertex[dwVertex].vTex0.y += -0.05f + (0.05f * sinf(g_pBreakanoid->m_fTime)); //Bewegung nach unten = y nimmt zu } } if((sin(g_pBreakanoid->m_fTime)<0) && (cos(g_pBreakanoid->m_fTime)<0)) //sin(x) negativ&fallend und cos(x) negativ&steigend // = pi bis 3pi/2 { for(DWORD dwVertex = 0; dwVertex < 4; dwVertex++) { aVertex[dwVertex].vTex0.x += -0.05f - (0.05f * sinf(g_pBreakanoid->m_fTime)); //Bewegung nach links = x nimmt ab aVertex[dwVertex].vTex0.y += -0.05f; //maximale Bewegung nach unten } } if((sin(g_pBreakanoid->m_fTime)<0) && (cos(g_pBreakanoid->m_fTime)>0)) //sin(x) negativ&steigend und cos(x) positiv&steigend // 3pi/2 bis 2pi { for(DWORD dwVertex = 0; dwVertex < 4; dwVertex++) { //x bleibt unverändert aVertex[dwVertex].vTex0.y += 0.05f * sinf(g_pBreakanoid->m_fTime); //Bewegung nach oben = y nimmt ab } }
aVertex[dwVertex].vTex0.x += -0.05f * sinf(g_pBreakanoid->m_fTime); //Bewegung nach rechts = x nimmt zu