ZankuR Director
Cantidad de envíos : 107 Fecha de inscripción : 19/07/2013
| Tema: Dx8 - Agua 3D Dom Ago 11, 2013 12:40 am | |
| lo saque de fenix, le saque algunas variables y lo adapte al engine de mannakia de 13.0 buscamos - Código:
-
Public engineBaseSpeed As Single abajo: - Código:
-
Public ma(1) As Single renderscreen buscamos: - Código:
-
If MapData(X, Y).Graphic(1).GrhIndex <> 0 Then Call DDrawGrhtoSurface(MapData(X, Y).Graphic(1), _ (ScreenX - 1) * TilePixelWidth + PixelOffsetX, _ (ScreenY - 1) * TilePixelHeight + PixelOffsetY, _ 1, 1, lighthandle) End If y lo reemplazan por esto: - Código:
-
'Layer 1 ********************************** lighthandle(0) = DayLight lighthandle(1) = DayLight lighthandle(2) = DayLight lighthandle(3) = DayLight Dim VertexArray(0 To 3) As TLVERTEX Dim tex As Direct3DTexture8 Dim SrcWidth As Integer Dim Width As Integer Dim SrcHeight As Integer Dim Height As Integer Dim SrcBitmapWidth As Long Dim SrcBitmapHeight As Long Dim xb As Integer Dim yb As Integer Dim iGrhIndex As Integer Dim srdesc As D3DSURFACE_DESC 'Ready the texture 'If grhindex = 0 Then Exit Sub If MapData(X, Y).Graphic(1).GrhIndex Then xb = (ScreenX - 1) * 32 + PixelOffsetX yb = (ScreenY - 1) * 32 + PixelOffsetY If MapData(X, Y).Graphic(1).Started = 1 Then MapData(X, Y).Graphic(1).FrameCounter = MapData(X, Y).Graphic(1).FrameCounter + ((timerElapsedTime * 0.1) * GrhData(MapData(X, Y).Graphic(1).GrhIndex).NumFrames / MapData(X, Y).Graphic(1).Speed) If MapData(X, Y).Graphic(1).FrameCounter > GrhData(MapData(X, Y).Graphic(1).GrhIndex).NumFrames Then MapData(X, Y).Graphic(1).FrameCounter = (MapData(X, Y).Graphic(1).FrameCounter Mod GrhData(MapData(X, Y).Graphic(1).GrhIndex).NumFrames) + 1 End If End If If MapData(X, Y).Graphic(1).FrameCounter = 0 Then MapData(X, Y).Graphic(1).FrameCounter = 1 If MapData(X, Y).Graphic(1).GrhIndex <= 0 Then Exit Sub iGrhIndex = GrhData(MapData(X, Y).Graphic(1).GrhIndex).Frames(MapData(X, Y).Graphic(1).FrameCounter) With GrhData(iGrhIndex) Set tex = SurfaceDB.Surface(.FileNum) tex.GetLevelDesc 0, srdesc 'If .sX = 0 And SrcHeight = 0 And Width = 0 And Height = 0 Then SrcWidth = 32 'd3dtextures.texwidth Width = 32 'd3dtextures.texwidth Height = 32 'd3dtextures.texheight SrcHeight = 32 'd3dtextures.texheight SrcBitmapWidth = srdesc.Width SrcBitmapHeight = srdesc.Height 'Set the RHWs (must always be 1) VertexArray(0).rhw = 1 VertexArray(1).rhw = 1 VertexArray(2).rhw = 1 VertexArray(3).rhw = 1 'Find the left side of the rectangle VertexArray(0).X = xb VertexArray(0).tu = (.sx / SrcBitmapWidth) 'Find the top side of the rectangle VertexArray(0).Y = yb VertexArray(0).tv = (.sy / SrcBitmapHeight) 'Find the right side of the rectangle VertexArray(1).X = xb + Width VertexArray(1).tu = (.sx + SrcWidth) / SrcBitmapWidth 'These values will only equal each other when not a shadow VertexArray(2).X = VertexArray(0).X VertexArray(3).X = VertexArray(1).X 'Find the bottom of the rectangle VertexArray(2).Y = yb + Height VertexArray(2).tv = (.sy + SrcHeight) / SrcBitmapHeight 'Because this is a perfect rectangle, all of the values below will equal one of the values we already got VertexArray(1).Y = VertexArray(0).Y VertexArray(1).tv = VertexArray(0).tv VertexArray(2).tu = VertexArray(0).tu VertexArray(3).Y = VertexArray(2).Y VertexArray(3).tu = VertexArray(1).tu VertexArray(3).tv = VertexArray(2).tv VertexArray(0).color = lighthandle(0) VertexArray(1).color = lighthandle(1) VertexArray(2).color = lighthandle(2) VertexArray(3).color = lighthandle(3) If (VertexArray(0).color = 0) Then VertexArray(0).color = DayLight If (VertexArray(1).color = 0) Then VertexArray(1).color = DayLight If (VertexArray(2).color = 0) Then VertexArray(2).color = DayLight If (VertexArray(3).color = 0) Then VertexArray(3).color = DayLight If HayAgua(X, Y) Then Dim ignorarpoligonossuperiores As Byte Dim ignorarpoligonosinferiores As Byte ignorarpoligonosinferiores = 0 ignorarpoligonossuperiores = 0 If HayAgua(X, Y - 1) = False Then ignorarpoligonossuperiores = 1 If HayAgua(X, Y + 1) = False Then ignorarpoligonosinferiores = 1 If X Mod 2 = 0 Then If Y Mod 2 = 0 Then If ignorarpoligonossuperiores <> 1 Then VertexArray(0).Y = VertexArray(0).Y - Val(ma(0)) VertexArray(1).Y = VertexArray(1).Y + Val(ma(0)) End If If ignorarpoligonosinferiores <> 1 Then VertexArray(2).Y = VertexArray(2).Y + Val(ma(1)) VertexArray(3).Y = VertexArray(3).Y - Val(ma(1)) End If Else If ignorarpoligonossuperiores <> 1 Then VertexArray(0).Y = VertexArray(0).Y + Val(ma(1)) VertexArray(1).Y = VertexArray(1).Y - Val(ma(1)) End If If ignorarpoligonosinferiores <> 1 Then VertexArray(2).Y = VertexArray(2).Y - Val(ma(0)) VertexArray(3).Y = VertexArray(3).Y + Val(ma(0)) End If End If ElseIf X Mod 2 = 1 Then If Y Mod 2 = 0 Then If ignorarpoligonossuperiores <> 1 Then VertexArray(0).Y = VertexArray(0).Y + Val(ma(0)) VertexArray(1).Y = VertexArray(1).Y - Val(ma(0)) End If If ignorarpoligonosinferiores <> 1 Then VertexArray(2).Y = VertexArray(2).Y - Val(ma(1)) VertexArray(3).Y = VertexArray(3).Y + Val(ma(1)) End If Else If ignorarpoligonossuperiores <> 1 Then VertexArray(0).Y = VertexArray(0).Y - Val(ma(1)) VertexArray(1).Y = VertexArray(1).Y + Val(ma(1)) End If If ignorarpoligonosinferiores <> 1 Then VertexArray(2).Y = VertexArray(2).Y + Val(ma(0)) VertexArray(3).Y = VertexArray(3).Y - Val(ma(0)) End If End If End If End If DirectDevice.SetTexture 0, tex 'Draw the triangles that make up our square Textures DirectDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, VertexArray(0), Len(VertexArray(0)) 'DirectDevice.SetRenderState D3DRS_FILLMODE, D3DFILL_WIREFRAME End With End If en el sub main buscamos [codedo while prgrun][/code] arriba ponemos - Código:
-
Dim alturaAgua As Integer Dim ma1_bajando As Byte alturaAgua = 6 y en el bucle principal - Código:
-
If ma1_bajando = 0 Then ma(0) = ma(0) + timerTicksPerFrame / 2 If ma(0) >= alturaAgua Then ma(0) = alturaAgua ma1_bajando = 1 End If Else ma(0) = ma(0) - timerTicksPerFrame / 2 If ma(0) <= -alturaAgua Then ma(0) = -alturaAgua ma1_bajando = 0 End If End If ma(1) = ma(0) If ma1_bajando = 0 Then ma(1) = ma(1) + (alturaAgua / 2) If ma(1) >= alturaAgua Then ma(1) = alturaAgua - (ma(1) - alturaAgua) Else ma(1) = ma(1) - (alturaAgua / 2) If ma(1) <= -alturaAgua Then ma(1) = -alturaAgua + Abs(ma(1) + alturaAgua) End If ma(1) = -ma(1) Bueno no se de que fuente es lo tenia en un block de notas y decia esto nomas espero que le sirva no me acuerdo de que foro era xd pero me acuerdo que tenia algo cambiado este codigo lo habia modificado saludos | |
|