Richard3d

Members
  • Content count

    37
  • Joined

  • Last visited

Community Reputation

110 Neutral

About Richard3d

  • Rank
    Member
  1. Hello, I have a newbie question regarding multithreaded networking. I have an application that uses eNet to pass and receive messages between a client and server. In this simple implementation I only need the server to pass data to the client. I have certain messages that come in different packets but the client needs to "handle" them at the same time for synchronicity issues between gameplay objects (This is a constraint by the way and cannot be changed for this project). My desired goal is to have the following -the client spawns a new thread which reads network packets off the UDP stream (this way network traffic is always being serviced regardless of framerate, so you can't get false timeouts from another piece of code) -the packets are stored into a dynamic array (STL vector) -the application (main process/thread) processes all the packets in the array when it is time for an update My questions are the following: What is the best strategy to make the vector thread-safe (since I can't have the network thread adding packets, while the main thread tries to read simultaneously)? Or maybe the better question is what is the best strategy to let the main thread know when the data is ready for processing/consumption and vice-versa (main thread tells network thread to collect more packets from the stream again)? The only problem with the second idea is that I don't want the network thread to hang/wait on collecting packets while the main thread does the processing. Should I use two vectors (one local in the network thread that is always filling and one shared between the two and then use an event?) Thanks in advance for helping a beginner - R
  2. Hello, I am wondering if anyone here can discuss some techniques for implementing collision detection / terrain querying for terrain engines that rely on geo-mipmapping techniques (such as geo clipmapping etc). Since all geometry is offset and actually height calculated on the GPU I am wondering how entities can perform height queries and also normal queries on the terrain. Reading geometry back is not an option as the transform happens on the GPU and the vertex buffer is unaltered (need this to work for D9 which it seems this has been done). The only other option I see is querying the heightmap itself but it seems lots of texture readbacks would be very expensive. Can any one shed some light here? Thanks - R
  3. Fast Simulation of Realistic Trees

    Thanks for the responses everyone though they were not quite what I was looking for. It turns out the mathematics were correct but I was getting some numeric imprecision. The key is the dampening and stiffness factors. The simulation becomes unstable when dampening is uniform across a branch. Decreasing the dampening a tiny amount over each successive node fixed the problems I was having. The idea of moving the simulation to the gpu is an interesting idea but the proposed method was not ideal for this type of simulation, rotational based springs are still much faster and model the physical characteristics of branches/trees much better than any position based method
  4. Hello Everyone, I am currently trying to implement a realistic dynamic vegetation system. I came across this awesome white paper found here [url="http://freeelectron.org/xTree/"]http://freeelectron.org/xTree/[/url] in pdf form. The paper is somewhat lengthy so I wont go into the details but the issue I am having problems with is calculating a node's final world position from it's relative angles in the respective XY and YZ planes. The article explains the process in depth and I am fluent with matrix and quaternion mathematics however their mapping from the separate 1D (angle wise) spaces to a single rotation (quaternion) is not working for me. I understand the axis-angle idea and the continuity behind but here is where I am seeing issues as well. Consider any node that resides in the XZ plane with a parent node fixed at the origin. If I project the vector (childPos-parentPos) onto the respective XY and YZ planes I would get an angle of 90 degrees (remember we are measuring from the Y axis as stated in the paper). There are many points in the plane that would have projections of 90 degrees in both planes unfortunately that always maps to a single rotation, where the angle = sqrt(90 *90 + 90 *90) and the axis = Norm(90, 0, -90). So where am I going wrong? I appreciate anyone taking the time to help with this! Thanks - Richard
  5. A lot of this has depends on the game you are doing FPS, Flightsim etc. The size of the scene also depends, and also if you plan on using the same hierarchy for collision. In my games I tend to use a grid based structure such as a quadtree. I do not let cameras be nodes and instead store them in a separate list. For each camera I find the visible nodes intersecting with the camera frustum. These are then stored into another tree that describes a scene (what a single camera would see). The tree can be an ordered map of some sort like a binary tree. I then order things based on material to help with the number of draw calls (all models with the same material get thrown into one buffer so i can use attribute instancing) nodes with an alpha value of less than 255 are weighted so they are deferred and then they are weighted again based on their depth value from the camera so blending is handled correctly. Anyways that's the down and dirty of my version!
  6. You don't necessarily have to split the object up into separate models depending on how you decompose your models. For instance the DX mesh or model format (the exact name escapes me at the moment) Stores materials, and the geometry associated with material ID's, this is very similar to material IDs in say 3d studio max. This way when you go to render your "single" model you render based on materials for ordering (hence alpha usually gets done at the end). This will also help you avoid making a transform hierarchy of models etc which may be useful if you dont care about the doors moving
  7. Hello, I am in the process of creating a new terrain rendering engine and obviously the issue of texture quality comes up. I have done a lot of reading regarding clipmaps (I am not referring to geoclipmapping even though it is a related subject) and Sean Barret's method for sparse virtual textures. I need a method to best handle high altitude flight AND low ground detail. Imagine a UAV 10000 ft in the air suddenly zooming down to ground level. Teleporting is also an issue. I know SVTs are great for memory but if you let the user jump all of a sudden to a new location its going to take a bit of time for the data to page in, I suppose the same is true for clip maps however I was wondering if anyone has used/implemented both or has any advice. Thanks in advance - Richard
  8. HAs anyone used anything from sparse hash? particularly the dense_hash_map? I am having some weird issues with it and documentation/support is sparse to say the least. If you have experience with this library and particular struct let me know! thanks, Richard
  9. Hello, I am curious as to what the best 3d flash packages are and the pros and cons. The features I am looking for (or at least having the possibility of adding myself via actionscript or an API) include interactivity (I need to let the user rotate and move objects, picking, camera movement etc). For instance swift3d from what I have seen is nice for animation but not so much for interactivity as compared to freespin3d. (If you want an example of th einteractivity I plan on implementing checkout windosill.com) Any advice would be greatly appreciated!
  10. I have searched all over for an answer to this...is there a way in my application to retrieve the time position of a cue. Basically I want to know how many seconds have elapsed since playback has started. Thanks - Richard
  11. Hello, I was just wondering if anyone knows of any software that has all o fthe functionality of SVN (Like Tortoise) but also allows you to define file relationships like an asset manager. Like If I had my own vector cpp defined and used in multiple projects I could right-click on that file and say it is used by game.proj, car.proj, etc. That way when SVN detects an update it would notify you which dependencies might be affected as well. If anyone knows of anything like this please respond. Thanks - Richard
  12. Well it looks like I finally may have found an answer. If anyone else is ever interested in doing this check out this guy's project http://www.codeproject.com/KB/debug/LibView.aspx?fid=144316&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26
  13. Thanks for the replies, I want to do this for a variety of reasons. One of which is because I want to build a tool where users can build higher level functionality from a graphical UI. That is they can select functions from within a dll and use them in a node based ui editor as building blocks (think maya's hypershade but much more generalized). The compiler will always be vc++ so that is a known ahead of time. Can any of you send me a link detailing the functions and maybe some code snippets? - Thanks again, Richard
  14. Hello, I am wondering if it is possible in c++ to extract info from a dll at runtime. Essentially I would like to pragmatically extract the equivalent of the header file info. I want to know if it is possible given just the dll to somehow enumerate the function names and parameters and pragmatically generate the info commonly found in a header file. If anyone has experience in doing this it would be greatly appreciated, or if it is not possible...what would be some other alternatives? - Thanks, Richard
  15. Relative roll pitch and yaw

    So I am working with a crappy engine (that I cannot change!) that utilizes roll pitch and yaw as the sole way to specify an entity's orientation in the world. I want to know how to convert relative roll pitch and yaw to world roll pitch and yaw. Here is an example: I have an aircraft at rpy(45,0,45) and I want a camera pointing off this aircraft's nose at a depression of 45 degrees (pitching negative 45 degrees of the nose relative to the aircraft (so the camera should have some roll in it). I thought the obvious answer was that if the relative orientation is to be rpy(0,-45,0). That the desired world orientation would be rpy(Aircraft) + rpy(cam relative) = rpy(cam world). This is obviously not the case so does anyone know how to do the conversion without converting to matrix and back etc?