Jump to content
Xtreme .Net Talk

Knight Chat X

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by Knight Chat X

  1. Yahoo, got it, thanks Pentium Person. So like that newSkinMeshUpdate.zip on http://robydx.altervista.org is the one you want to go for, if you've got Visual Studio 2005 you'll need to take care of some minor errors using the IDE's Error List, but once that's all taken care of you can optionally take care of the minor Warnings List bugs as well, once you do that the sample should startup just fine. On the functions which don't return a value on all paths, simpley add return nothing at the end of the functions, and replace the animation return function with return <> code for the textures. For the bones and materials variables add = Nothing to the ends. For constant rad add As Integer, may also need to remove any unsupported form creation properties by commenting them out, after that it's all good.
  2. Did you guys ever get it to work? This is one of the main reasons they should have included VB.Net samples in the DirectX 9.0c SDK, because people wouldn't be stuck as long on these sort of problems. But they are just too lazy to add them else they would have, but it's just too much for them to update the code because they know when they update 1 sample, they must update them all, and that's not our faults either they made so many changes to make it that way, so they expect us to just easily convert entire projects over to our native .Net languages and let me tell you it is not that simple, even when using a C# to VB.Net convertor tool, the coding styles vary from language to language a bit. For instance, the C++ and C# DirectX coding samples rely heavily on special helper classes such as DXUtil which in most applications you will never ever use any of those, and the sight of them annoys me as it normally requires me digging through those files to sift through what's in a custom version that's not in the rest, so I can seperate it anyways to an equivalant function. :mad:
  3. Here's a copy from another messageboard I posted on: I'm trying to find some source code samples to make up for the problems converting the code from C# to VB.net. I export the framed animations to a single .x file using the 3rd party Lightwave D-Storm plugin. I tried checking out Rene's sample which was said to be VB.net and DirectX 9 but I find it's only in C# and it's not working on Visual Studio 2005 for me. I'm not looking for example using a 3rd party format, just the native DirectX .X file mesh animation format. So does anyone know of where to find animation source code sample in VB.net for regular .x file animations? Weither it's a simple box animation or an example of how to make Tiny.x move would be much appreciated.
  4. You can also simply use degree's, such as 60, 90, 180, etc..
  5. The bounding box values are updated and based on the position of the moving object, thus, the bounding values for any moving object is variable, meaning it changes. If the object moves right to X+ (1.0F) and the object was originally at X (0.0F) then update the bounding information to reflect the current position, the objects right boundary would now be X+ (2.0F) instead of X+ (1.0F). You only need to update the values for moving objects, but the comparison remains the same regardless of weither object is moving or not, just remember to update the bounding values of all 4 boundaries when object is moved.
  6. Ignore the Y for now assuming the Y Axis is up until you become familiar with the concept to do more complicated detection. It's as simple as this. Let's say your back wall in a room is as Z+ (12.0F), the front wall is at Z- (-12.0F), your charactor can move forward or backwards along the Z Axis as long as it's between Z+ (12.0F) and Z- (-12.0), allow charactor input of the direction you are moving until you get to the boundary. Example: Charactor has now moved up until it reached Z+ (11.0F), the input for charactor moving forward is now disabled, so any time you press the up arrow key to move forward the charactor will not move forward, that's it! The reason we stopped at Z+ (11.0F) instead of Z+ (12.0F) is we assume the charactor has a size of (1.0F), now the size of your geometry will vary so you'd have to adjust bounding calculations for that. It helps to visualize this data in realtime, so display the vector position of your charactor (X,Y,Z) in the forms title text and compare to bounding box of your room's walls. Adjust collision detection to match how the charactor responds when it reaches certain points, if for instance the charactor get's stuck, you need to adjust detection a bit to allow movement but restraint direction where collision happens. Later on when you get more comfortable with this, for walls inside a room, such as for a hallway, you create inner bounding box's that make up the sides of a wall. I've added some pictures to help visualize what I'm saying, the lower box is the main charactor, upper box is another charactor or object in the room, the red lines show the walls, the ones with arrow's show movement, the cross is projectile, but I also use it for making manual boundary calculations.
  7. Overview: Can use inner/outer boundary box. Outer detects collisions for outer walls of a room. Inner detects collisions which take place when charactor comes acrossed an object in the room, such as another charactor, or table. Simple Rules: Movement should be restrained so as not to allow charactor to cross over an object in a room. Charactor should not be able to move past outer walls. Boundary Box: Setup an imaginary box, then type in coordinates, eg. upper/lower/left/right borders and if charactor comes near, do not allow it to pass, yet allow it the ability to move in other directions as long as it doesn't come across another boundary. 4 direction charactor movement outer boundary detection: Take for instance you move charactor up, your upper boundary for the rooms back wall is at Z+ (12.0F) your charactor should not pass 12.0F, and no longer be given ability to move up once the upper bound has been reached, yet the charactor should be allowed to move left, right, or down. All 4 directions must be treated this way. Inner boundary detection: Your charactor should not pass the boundary of another object in the room, yet should be allowed to move around the object. For example: Object is at center of room, the right side of the object is boundary X+ (1.0F), if your charactor moves towards the left, it should no longer be able to move once the charactor reaches the right boundary of the object in the room. Yet, the charactor should be allowed to be able to move up, down, or right. Do test for each direction your charactor moves. Basically you are comparing your charactors position with that of the defined object boundaries. Testing multiple objects in room: Store a list of boundary structures for each object in the room/level, everytime the charactor moves in any given direction, check each boundary value in the list to see if a collision has happened. Projectile: Let's say we want to fire projectile at object in room, you want it to test for boundary collisions the same way as if it were the charactor moving, when the projectile reaches an objects boundary, have it perform some action. To return which object was hit by the projectile, simple return the name of the object that is linked to the boundary that was hit. Charactor interaction/menu activation: If you were playing an RPG you'd know that when your charactor comes face to face with another charactor or object in the scene, a menu may popup or charactor dialog, so how is this done? Simple, the same as with the other methods, when your charactor comes accross the boundary of another object, a message can be displayed then to indicate further action, for example: Your charactor moves up and hits the lower boundary of a genie, the genie asks you what you wish, you give keyboard or mouse input to make your choice, then you go from there. Well, hope all this has made some sense so far, goodluck! :cool:
  8. Simple process, the good thing about this is you load .fx shaders the same way given you add some extra code to handle the rendering passes. The reference information is in the .X File. If your mesh has been saved with the appropriate references then when you load it it will automatically load this information for you in arrays, all you need to do is setup a simple render loop for the object and apply your textures, etc.. :D :rolleyes: :p :cool:
  9. When it came out the documentation was and still is lacking full VB.Net support, and I think that's the point, there wasn't any books at the time on this subject covering VB.Net with up-to-date samples which worked once you compiled them, this was due to the changes which took place after release. I won't sugar coat it it was a pain in the *** at first until you realize the old prototype names have been branched into a more organized way, once you get the hang of it it's much simpler than the previous VB days. MDX is better now, the old books that attempted to cover VB.Net became outdated, now there are a few more books than before, the documentation at the time of this poll that CBX made was true, the lack of documentation sucked and the poll results further back that up. Right now there is no VB.Net examples in the SDK and I don't care what excuses anyone has, you release a new API feature set and expect it to be used to the fullest make some effort at making documentation available, don't just hand em a rocket engine and figure out how to start it, ya run into unneccessary error's then and chance blowin the rocket engine to nothing, then it's a waste. The future is bright now, let's see some more samples, I'd like to see free videos online showing more code coverage, the more info. we make available to other developers, the quicker we can get the ball rolling to new and better things.
  10. Looks more like the bare GDI+ library, which is probably why it doesn't show up in DirectX references. To answer the question, yes you can draw lines, circles, and other things in DirectX, it's a little more complicated though, try seeing some of the tutorials in the SDK, paticularly the Vertices Triangle Example, you may also do some searching on how to draw basic primitive shapes online, Microsoft provides some information related to this in the MSDN library for DirectX. The DrawPrimitive method is what you'd use more than likely, create 2 points for both ends of a line and draw the line between both points. Here's DrawPrimitive: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx81_vb/directx_vb/graphics/reference/vb/d3d/classes/direct3ddevice8/drawprimitive.asp And you can see here you there is a line list as an option: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx81_vb/directx_vb/graphics/reference/vb/d3d/classes/direct3ddevice8/drawprimitive.asp :D
  11. Hello There, I don't know what you are using to create the meshes but if you're using a program such as Maya or Poser then the you have to assign a material specific to isolated portions of whatever object you wish to have a texture, that would be done for each texture you wish to be linked to the mesh object, then you export the object as an .x file, optionally you can use code or the MeshViewer to optimize a mesh or create a simple mesh primitive. You load the mesh like so: objMesh = objMesh.FromFile(Application.StartupPath & "\box.x", MeshFlags.SystemMemory, device, MeshExtendedMaterials) Create a material array based on the size of MeshExtendedMaterials, create and store default materials in the array, do the same for all textures associated with the mesh object. Use an index to properly place each material and texture on the object. If you're planning on loading an animated mesh where all of the frames and information is in a single .x file then try checking out this link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndrive/html/directx11192002.asp :D
  12. Hello, I've put out a post for an alternative to DrawText for those having problems with it or are just looking for an alternative way of drawing text, with this method you've got full control of the text as a mesh object, therefore, you may handle it just like any other mesh object, can be used for 2D or 3D text, it can also be modified and put in a class to be more useful, such as for easy text color modification, font size, style changes, special font effects, animation, rotation, and much more: http://www.xtremedotnettalk.com/showthread.php?t=88192&page=2&pp=20 Enjoy! :D
  13. DrawText (Alternative) When I converted to DirectX 9.0c ran into the same problem with DrawText, it's very strict with parameters, while working with font declarations I finally got it to work as expected, when I finally got it down to where the syntax worked, the program ran but didn't display text, I later found this to be because of the DrawTextFormat settings, some settings will render the font while others won't. I've moved onto other things and now I can't find the class I made to work with DrawText easier, but even when things were going well I realized DrawText was incredibly impacting my frame rates slowing down and not doing well with memory performance, and the more text displayed the worse it was so I went in search of an alternative and considered using a generated text mesh, and behold it works like a charm. Basically it's setup like this: 'Global Variables. Private mesh3DText As Mesh = Nothing 'Mesh to draw 3d text. Private fontName As String = "Arial" 'Name of the font you wish to use. Private FontSize As Integer = 10 'Size of the font. Private textMaterial As Material 'Material to color text. Private matFont As Matrix = Matrix.Identity 'Matrix to position and scale. text. Private currentFont As System.Drawing.Font 'Variable that stores the font. 'Put this code where your Direct3D device is initialized. 'Create a new font using the given parameters.. currentFont = New System.Drawing.Font(fontName, FontSize) 'Create 3D Text Mesh. mesh3DText = Mesh.TextFromFont(mobjDX9, currentFont, "This is a test message...", 0.001F, 0.4F) 'Create the material that will be used for the mesh. textMaterial = New Material textMaterial.AmbientColor = New ColorValue(0, 16, 180, 255) textMaterial.DiffuseColor = New ColorValue(0, 16, 180, 255) 'Now put this in the render portion of the program to render the text. 'Set text mesh rotation. Dim matRot As New Matrix matRot.RotateYawPitchRoll(0, 0, 0) 'XYZ 'Set text mesh scale. Dim matScale As New Matrix matScale.Scale(5.0F, 5.0F, 1.0F) 'XYZ (Note: To change font depth change Z, a higher value will result in more 3D look while lower results in a flatter 2D look.) 'Set text mesh position. Dim matPos As New Matrix matPos.Translate(-20, -10, 0) 'XYZ 'Combine all matrix calculations. mobjDX9.Transform.World = Matrix.Multiply(Matrix.Multiply(matRot, matScale), matPos) mobjDX9.Material = textMaterial 'Set material for render. mesh3DText.DrawSubset(0) 'Render Mesh/DrawText. :cool: :D
  14. Shockwave Flash object A few other options are available, browser object, a media player object, API, etc...
  15. All languages are pretty much the same really, built on standard concepts, the key to choosing the right language for the job is dependant on how well and easy it is to accomplish a task using the given knowlege and resources. When you master various languages as a programmer/developer, you become more flexible. Assembler that works like VB, hmmm, good idea, it's possible to create an IDE yourself, develop your own programming language syntax, include basic functionality to expand on or use any available API code combined, use the language syntax you're comfortable with, then have it all converted to lower level code through the compiler and finally into a high performance and optimized program. It takes alot of time, patience, and conversion, but it can be done! ;o)
  16. Sounds's like alot of pixel data is being lost somewhere, does the second image look different than the first image? It could just be a simple change in JPEG compression settings. JPEG's lose pixel data the more they are transfered and/or modified, thus reducing quality and overall size of the file. JPEG is a graphical compression standard for images, so anytime you re-save the same image data/bits you are re-compressing it. In your example: Dim saveImage As Image = Image.FromFile("C:\sourcefile.jpg") saveImage.Save("C:\test.jpg", myImageCodecInfo, myEncoderParameters) You are loading an already compressed JPEG image file, then you are re-saving it to another file thus re-saving the data and thus losing pixel data/bits. :-\
  17. If I use APIViewer 2003 or the built-in VB6 to VB.Net convertor it produces the declare below. Declare Function GetDIBits Lib "gdi32.dll" ( _ ByVal aHDC As Int32, _ ByVal hBitmap As Int32, _ ByVal nStartScan As Int32, _ ByVal nNumScans As Int32, _ ByRef lpBits As Any, _ ByRef lpBI As BITMAPINFO, _ ByVal wUsage As Int32) As Int32 Giving an error: 'As Any' is not supported in 'Declare' statements What needs to be done to properly declare the function?
  18. So far my experiences with DirectX have been that more time has been spent searching for adequate documentation VS. actually programming. Yet, now the same is true for me and VB.Net, I've been programming for years now and finally managed to take a look at Visual Studio .Net, now I'm finding myself struggling because of all the drastic changes that have been made, the same goes for DirectX. And the lack of adequate documentation is the same now as it was before, only now the changes are vast. Don't get me wrong, there are many books out their designed by individual's that have taken the hard time to create guides to programming method's through trial and error, and in most cases, I think 2000 pages to describe 1 topic is overboard, but they are out there somewhere, I just wish Microsoft did better to providing the information in the SDK. Another example is the incomplete examples in the SDK, if you can do video programming in C++ , you shouldn't have to be forced to create a C++ DLL so it can be used in VB .Net just because they didn't provide an example or functionality of it already. C++ examples in most cases are just fine, the problem is for true compatibility and flexibility acrossed all Visual Studio languages, you shouldn't need to use a specific language elsewhere to do the same task in another.
  19. I've provided a complete yet simple project developed in VB6 in this message which does this, however, I need to be able to do the same in VB. NET, and so far haven't found anything about putting the image into an array, then using the array to display image again, or anything about converting array to string, then string to array and displaying image in VB .NET. -Thanks SetDIBits.zip
  20. Think I found the answer here: http://www.xtremedotnettalk.com/showthread.php?t=49319 That's a very good read, covers various topics related to GDI+ programming and it's simple, yet effective! :D
  21. Thanks! 'The problem lies here: Public Function CreateListeningSocketThreadAndStartMessageProcessing(ByVal MyMethod As Method) As TcpListener I already have a method without parameters for the AddressOf which would work, but the problem is with the MyMethod parameter declaration within the CreateListeningSocketThreadAndStartMessageProcessing function itself, see, there is no Dim Something As Method that I know of. The reason I'm trying to use function in a class is so I can re-use the code for creating the thread within a class, yet still work with the message handler "MyMethod" linked to the thread on main form, this way I can ignore the code within the class and focus more on the events. Public Function CreateListeningSocketThreadAndStartMessageProcessing(ByVal MyMethod As ???) As TcpListener What would the parameter/argument syntax for the function be?
  22. The problem I have is I need to be able to pass the address of a method from another sub or function in a class. The function below does not work as I can't declare as a method, "MyMethod" is a method elsewhere in the program which processes messages. Public Function CreateListeningSocketThreadAndStartMessageProcessing(ByVal MyMethod As Method) As TcpListener CreateListeningSocketThreadAndStartMessageProcessing = New Threading.Thread(AddressOf MyMethod) 'THIS DOES NOT WORK... CreateListeningSocketThreadAndStartMessageProcessing.Start() End Function Is there solution?
×
×
  • Create New...