
rifter1818
Avatar/Signature-
Posts
257 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by rifter1818
-
I need an exporter for Maya 5,.. Either to .x or to 3ds files,.. only problem is all the ones i see are hundreds of dollers,.... i want to spend $0.
-
Finnally Finnally have working mesh,... Heres My Class, the .anm file contains the number of keyframes and the addresses of each mesh,..... Public Class AnimatedMesh Public cmesh() As CustomMesh Public tMesh As CustomMesh Public Key1 As Int16 Public Key2 As Int16 Public Dtime As Single Public Const tChange As Single = 0.05 Public KOT As Int16 Public KeyOrder() As Integer Public Structure vertexlist Public vertexs() As Vertex End Structure Dim vertexlists() As vertexlist Public Function LoadAnimatedMesh(ByVal anmFile As String, ByVal fFolder As String, ByVal device As Direct3D.Device, ByVal Texturefolder As String) Try Dim icount As Int16 Dim icount2 As Int16 Dim keys As Int16 Dim stemp As String Dim Gs As GraphicsStream FileOpen(1, fFolder & anmFile, OpenMode.Input) Input(1, keys) ReDim cmesh(keys) ReDim vertexlists(keys) Do Until EOF(1) Input(1, stemp) cmesh(icount) = New CustomMesh vertexlists(icount) = New vertexlist cmesh(icount).LoadMesh(fFolder, stemp, DX9.D3DDevice, Texturefolder) icount += 1 Loop FileClose(1) tMesh = cmesh(0) For icount = 0 To keys - 1 ReDim vertexlists(icount).vertexs(cmesh(icount).xMesh.NumberVertices) Gs = cmesh(icount).xMesh.LockVertexBuffer(LockFlags.None) For icount2 = 0 To cmesh(icount).xMesh.NumberVertices - 1 vertexlists(icount).vertexs(icount2).p.X = Gs.Read(GetType(Single)) vertexlists(icount).vertexs(icount2).p.Y = Gs.Read(GetType(Single)) vertexlists(icount).vertexs(icount2).p.Z = Gs.Read(GetType(Single)) vertexlists(icount).vertexs(icount2).n.X = Gs.Read(GetType(Single)) vertexlists(icount).vertexs(icount2).n.Y = Gs.Read(GetType(Single)) vertexlists(icount).vertexs(icount2).n.Z = Gs.Read(GetType(Single)) vertexlists(icount).vertexs(icount2).tu = Gs.Read(GetType(Single)) vertexlists(icount).vertexs(icount2).tv = Gs.Read(GetType(Single)) Next cmesh(icount).xMesh.UnlockVertexBuffer() Key2 = 1 Next Catch ex As Exception Debug.WriteLine("Load Annimated Mesh:" & ex.ToString) ExitGame() End Try End Function Public Function DrawAnimatedMesh(ByVal automatic As Boolean, ByVal d3ddevice As Direct3D.Device) Dim icount As Int16 Try If automatic Then Dtime += tChange If Dtime > 1 Then Dtime = tChange KOT += 1 If KOT >= KeyOrder.Length Then KOT = 0 End If Key1 = Key2 Key2 = KeyOrder(KOT) End If End If Dim gs As GraphicsStream gs = tMesh.xMesh.LockVertexBuffer(LockFlags.None) With vertexlists(Key2) For icount = 0 To vertexlists(0).vertexs.Length - 2 gs.Write((lerp(vertexlists(Key1).vertexs(icount).p.X, .vertexs(icount).p.X, Dtime))) gs.Write((lerp(vertexlists(Key1).vertexs(icount).p.Y, .vertexs(icount).p.Y, Dtime))) gs.Write((lerp(vertexlists(Key1).vertexs(icount).p.Z, .vertexs(icount).p.Z, Dtime))) gs.Write((lerp(vertexlists(Key1).vertexs(icount).n.X, .vertexs(icount).n.X, Dtime))) gs.Write((lerp(vertexlists(Key1).vertexs(icount).n.Y, .vertexs(icount).n.Y, Dtime))) gs.Write((lerp(vertexlists(Key1).vertexs(icount).n.Z, .vertexs(icount).n.Z, Dtime))) gs.Write((lerp(vertexlists(Key1).vertexs(icount).tu, .vertexs(icount).tu, Dtime))) gs.Write((lerp(vertexlists(Key1).vertexs(icount).tv, .vertexs(icount).tv, Dtime))) Next End With tMesh.xMesh.UnlockVertexBuffer() tMesh.DrawMesh(DX9.D3DDevice) Catch ex As Exception Debug.WriteLine(Key1 & " " & Key2 & " " & Dtime & " " & icount & "/" & vertexlists(0).vertexs.Length - 1) Debug.WriteLine("Draw Animated Mesh:" & ex.ToString) ExitGame() End Try End Function Public Function lerp(ByVal n1 As Single, ByVal n2 As Single, ByVal time As Single) As Single Return ((n2 - n1) * time) + n1 End Function End Class Thank you all for the Help you have given me i hope this code helps some of you,...
-
Well Tweening is getting Closer Ive finnaly figured out how to get the vertex's out of the mesh now i have to put the new ones back in,... Any advice? By the Way im creating an annimated mesh class once i figure this out so ill post it here thanks for all the help so far and yet too come.
-
Parse? As the title says.
-
ok,.. dont really understand C++ all that well, IM a vb programer,.. and ive been working on tweening cause it doesnt seem so hard, big deception, i still cant find a way to extract the verticies from the meshs.. ive tried copieing the dolphin example and it doesnt work for me!
-
Directx4vb.com was helpfull But its in dx8 with vb 6, i couldnt figure out how to get the verticie data from the meshs so i could manually interpolate. Thanks very much though hopefully i can do it with the skinned mesh
-
So far .. all the advice ive got has been to look at the dolphin sample, which i found too hard to follow,.. if anyone could help us out with a better sample or explain animating meshes to us that would be great....
-
Error passing VertexBuffer to Draw function (VB.NET)
rifter1818 replied to Obvious's topic in DirectX
Im Getting a simular error Only difference is my vertex buffer is positioncolored, and about 1500 verticies. -
Found the answer Forgot to disable lighting before rednering the points.
-
Yup sure do want Alpha blending But how do i get it to be semi-transparant? I use alphablending elsewhere but thats for fully transparant. Also i dont know how to use alphablending on non-textured primitives.
-
For my rpg im now programming some basic magic animation and ive figured what i want for ice but i dont know how to do it... What i need is to create semi-transparant surfaces (like a blue glass to simulate a sheet of ice) these would be using simple triangle lists or strips and also linelists or line strip primitives, preferably vertextype posistioncolored. I would like to do it without textures,... so how do i create these primitives to be semi-transparant? And a second easier question, how do i set the width of the line that the linestrip primitive draws?
-
One thing i found more helpfull than that converter Was the panda plugin for 3ds max 5 it allows you to export directly from 3d studio max and i like the interface for it better and find it easier to use, Hope this helps someone out there :D Harry
-
Im having wierd color problem with a point sprite setup i have going for my magic effect. It seems no matter what i set the colors equal to, it comes up as black,.. Im using position colored verticies, the device was initialized in A8R8G8B8.. Please let me know if you have any ideas what could be doing that,.. Colors ive tryed: RGB(red,green,blue) RGB(blue,Green,red) RGB(255,255,255) 0 -16777216 1677215 color.fromargb(red,green,blue).toargb color.fromargb(255,255,255).toargb color.white.toargb
-
Just a guess.... Could it be that you need a clippper as until the object is fully on screen (without a clipper) it isnt shown so even though your object may start above the screen and move down it isnt visible until its on the screen, im not really sure on how to make a clipper, i think there might be a tutorial on it at http://www.directx4.net or http://www.directx4vb.com but im not sure... Hope this helps
-
You dont have to pre set the smallest variable. Would it not be better to make the smallest equal to the first line, then input the rest and compair, this will work no matter what variable type you use! Private Sub btnFindSmallest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFindSmallest.Click 'Finds smallest of a collection of numbers. Dim smallest, num As Double Dim sr As IO.StreamReader = IO.File.OpenText("DATA.TXT") if sr.peak <> -1 then smallest = cdbl(sr.readline) Do While sr.Peek <> -1 num = CDbl(sr.ReadLine) If num < smallest Then smallest = num End If Loop end if End Sub I think that should do it...
-
You dont have to pre set the smallest variable. Sorry double Posted,....
-
Have looked at the dolphin example However i couldnt understand it, too much code doing too many things ex. there are three meshes which i didnt find the file for and i rem ed out 2 of them and there was no change which didnt make any sence what so ever to me so i decided to focus on it more once i got another problem im still working on fixed. And until i get that fixed im kinda hoping that this forum will turn up an easyer to understand example.
-
Thank you For your support your method makes sence to me, i really should have figured that out myself seeing as i think im a good math student,... actually its more the everyone says im a brilliant math person yet somehow i get bad marks and need to ask people how do to just about everything.... go figure. anyways i think i can get some coding done based off your suggestion unfortunatly the really simple click idea doesnt work as the menu appears on a timer event,... but clicking would be so easy.... Now just my annimation question left for now i guess.....
-
Im building a 3d rpg with a battle system simular to that of FF tactics, i have built the 3d part of the battle all the terrains are there and the charactors and monsters anyways now comes what should be the easy part, drawing the menus what i need is to put in a 2d square (menu,popup whatever you want to call it) on the screen next to the chrarctor(s), the only problem is where is the charactor? i have the 3d coordinants x,y,z but how do i figure out where these are on the screen (2d) thanks in advance for your help.
-
Im reading the tutorial on directx4vb.com on animating meshes in dx8 but i cant figure out how to extract the verticies in dx9 heres the code in 8 ReDim CreateKeyFrameFromFile.VertexList(CreateKeyFrameFromFile.Mesh.GetNumVertices) As D3DVERTEX hResult = D3DXMeshVertexBuffer8GetData(CreateKeyFrameFromFile.Mesh, 0, Len(CreateKeyFrameFromFile.VertexList(0)) * _ CreateKeyFrameFromFile.Mesh.GetNumVertices, 0, CreateKeyFrameFromFile.VertexList(0)) please help me, if anyone has a sample project of an animated mesh that would be helpfull too
-
Im sorry for bothering you and then getting the answer myself, The solution was to create two seperate matricie, one with the rotation and one with the translation then multiplying them together, i figured it would be something like that but i couldnt figure it out wether it was multiply or add or a totatly different function that would combine the matricies correctly. Thank you all for you help
-
Ok, im pretty much a begginer at using matrix.whatever math,a begginer in 3d graphics in general but none the less i got my program semiworking. I have two functions using matrix math, Translate (vector3) and rotatey(angle) now if i say translate(vector3) and then draw the mesh it draws the mesh where i want it to, or if i say rotatey(angle) then draw the mesh it draws it at the correct angle, the problem is i want to to BOTH for the same mesh but it only does the latter, if i call Translate(vector) then Rotate(angle) then draw it only rotates or if i call Rotate then translate then draw it only translates! help me please what do i do to do both? Public Sub RotateY(ByRef angle As Single) D3DDevice.Transform.World = Matrix.RotationY(angle) End Sub Public Sub Translate(ByRef vector As Vector3) D3DDevice.Transform.World = Matrix.Translation(vector) End Sub 'seperate module For icount = 0 To numMonsters - 1 DX9.RotateY(Monsters(icount).Angle) DX9.Translate(New Vector3(Monsters(icount).x * 151, 0, Monsters(icount).y * 151)) Monsters(icount).mMesh.DrawMesh(DX9.D3DDevice) Next For icount = 0 To numCharactors - 1 DX9.RotateY(Charactors(icount).Angle) DX9.Translate(New Vector3(Charactors(icount).X * 151, 0, Charactors(icount).Y * 151)) Charactors(icount).cMesh.DrawMesh(DX9.D3DDevice) Next
-
Thanks,... This problem has been fixed, still argueing about transperancys in my texture but meh i can fix that latter thanks again.
-
Yet another of my updated areas is giving me trouble,... my drawing of menus seems not to be working, all it is is drawing a 2d box (actually a 3d rectangle but all the z's are 0) the problem is that once i swiched it to textures it seems to have disapeared! help me please! Public Function LoadTexture(ByVal sName As String) As Texture LoadTexture = TextureLoader.FromFile(D3DDevice, sName, 64, 64, 1, 0, Format.A8R8G8B8, Pool.Managed, Filter.None, Filter.None, RGB(0, 0, 0)) End Function Public Sub drawsquare(ByRef texture As Texture, ByVal x1 As Long, ByVal x2 As Long, ByVal y1 As Long, ByVal y2 As Long) Dim vbuff As VertexBuffer vbuff = New VertexBuffer(GetType(CustomVertex.PositionTextured), 6, D3DDevice, 0, CustomVertex.PositionTextured.Format, Pool.Default) 'create a new instance of the VertexBuffer object Dim vertices As CustomVertex.PositionTextured() = DirectCast(vbuff.Lock(0, 0), CustomVertex.PositionTextured()) 'lock the vertex vertices(0).X = x1 vertices(0).Y = y1 vertices(0).Tu = 0 vertices(0).Tv = 0 vertices(1).X = x2 vertices(1).Y = y1 vertices(1).Tu = 1 vertices(1).Tv = 0 vertices(2).X = x1 vertices(2).Y = y2 vertices(2).Tu = 0 vertices(2).Tv = 1 vertices(3).X = x2 vertices(3).Y = y2 vertices(3).Tu = 1 vertices(3).Tv = 1 vbuff.Unlock() 'unlock the vertex buffer D3DDevice.RenderState.Lighting = False D3DDevice.RenderState.CullMode = Cull.None D3DDevice.SetTexture(0, texture) D3DDevice.SetStreamSource(0, vbuff, 0) 'set the source for drawing the vertices D3DDevice.VertexFormat = CustomVertex.PositionTextured.Format 'the format of the vertex D3DDevice.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2) 'draw the triangle End Sub
-
k Stupid me Fixed it for windowed mode If Not windowed Then d3dpp.BackBufferCount = 1 d3dpp.BackBufferFormat = ColorFormat d3dpp.BackBufferHeight = ScreenHeight d3dpp.BackBufferWidth = ScreenWidth End If But i dont really want windowed mode,... how do i get full screen to work?