Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by isenthalpic53

  1. I am working with a VBA script run inside of Excel that can be used to feed parameters into a planing hull simulator. I am compiling a .odl file to generate a typelib (.tlb) but it appears that the typelib is not being properly registered, meaning when I add new functions they are not showing up. Although the system gives a current date and time when I actually view the typelib using OleView it is clear that the changes I tried to make during the compilation are not getting through. Similarly, if I, say, keep everything else the same but change version from 1.0 to 1.1, the registry only shows version 1.0 (what I currently have installed) but as I understand it should have a subfolder for each version. I am using Visual Studio 2005. Here are snippets of the odl // pwrs.odl : type library source for pwrs.exe // This file will be processed by the MIDL compiler to produce the // type library (pwrs.tlb). [ uuid(FBA79343-34E9-11D1-8A7F-000000000000), version(1.1) ] library Pwrs { importlib("stdole32.tlb"); // Primary dispatch interface for CPwrsDoc typedef enum { // Vessel Characteristics VCH_FOREPERP = 1, VCH_AFTPERP, VCH_LCG, VCH_VCG, VCH_RG, VCH_W, VCH_KAR, VCH_CBF, VCH_CBMM, VCH_CDC, VCH_CPILEUP1, VCH_CPILEUP2, VCH_CPILEUP3, VCH_CPILEUP4, VCH_OPVELOCITY, VCH_CALMHEAVE, VCH_PITCHRG, VCH_ROLLRG, VCH_TCG, VCH_B22Q, VCH_B44Q, VCH_B66Q, VCH_LATADMFACTOR, VCH_ROLLADMFACTOR, VCH_ATRANSOM } enumVesselChar; ... (all other required enums defined) ... [ uuid(FBA79344-34E9-11D1-8A7F-000000000000) ] dispinterface IPwrs { properties: // NOTE - ClassWizard will maintain property information here. // Use extreme caution when editing this section. //{{AFX_ODL_PROP(CPwrsDoc) [id(1)] boolean bPrintHeadings; [id(2)] boolean bPrintTitle; [id(3)] short cDelim; ... [id(25)] enumHydCoeffStatus iHydParamStatus; [id(26)] short iOpVelUnits; [id(27)] enumResidForceMode iResidForceMode; [id(28)] double dCalmHeave; //}}AFX_ODL_PROP methods: // NOTE - ClassWizard will maintain method information here. // Use extreme caution when editing this section. //{{AFX_ODL_METHOD(CPwrsDoc) [id(29)] boolean SetVesselChar(enumVesselChar iVar, double dVal); [id(30)] double GetVesselChar(short iVar); ... [id(166)] boolean SaveTextWindowAs(BSTR sPath); [id(167)] boolean SimpleHydrostatics(VARIANT_BOOL bCtrlValid); //}}AFX_ODL_METHOD }; // Class information for CPwrsDoc [ uuid(FBA79342-34E9-11D1-8A7F-000000000000) ] coclass Document { [default] dispinterface IPwrs; }; //{{AFX_APPEND_ODL}} //}}AFX_APPEND_ODL}} };
  2. isenthalpic53

    Opinion about 'uniblue registry cleaner'

    Thank you for the informed replies.
  3. I am looking at UniBlue's registry cleaner. Does it seem like it's worth the $30? UniBlue registry cleaner [Edited by - Ravuya on August 16, 2009 12:45:33 AM]
  4. isenthalpic53

    Collision and Contacts with friction

    compute the impulse to exactly change the tangential velocity to zero and compare it with the dynamic friction force and the static friction force and select the proper one to use.
  5. isenthalpic53

    Physics of flight: turning

    If you want to make it really nasty look for the gyroscopic effect (pitching an airplane with a spinning propellor creates a roll moment). That's just kind of annoying/stupid for most practical flight simulators though (but something I wasn't even aware of until recently).
  6. isenthalpic53

    OpenGL NURBs to vertex

    I snagged the mesa GLU NURBS implementation and for my purposes it's exactly what I need. Thank you for the suggestion.
  7. isenthalpic53

    OpenGL NURBs to vertex

    At some level OpenGL (well, glu) turns your control points/knots into vertex data before rendering. Is there a way to get access to these vertices? I have a hull form of a containership, describe by splines (4th order I think), and I'm trying to take this data and turn it into flat panels (for which I need the vertex data). Thanks for reading.
  8. isenthalpic53


    I recompiled the jpeg.lib with VS 2005. I could build the application if I statically linked to MFC, but that inflated my binary to 3 MB, up from about 200KB. If anyone's interested, I've included the updated .h and .lib files here: http://www.yourfilehost.com/media.ph...eglib_VS2005.h http://www.yourfilehost.com/media.ph...peg_VS2005.lib
  9. isenthalpic53


    Not sure if this is an inappropriate place to put this question. I have been trying to add jpeg loading code to an MFC application in Visual Studio 2005. I'm not sure if I'm linking in a bad order or using improper compiler options, etc. I've been poking around for well over an hour, I'm sure this is something minor, but when I add my texture loading code, which uses jpeg.lib, I get the following error: Quote: 1>jpeg.lib(jerror.obj) : error LNK2019: unresolved external symbol __iob referenced in function _output_message 1>.\Debug/Viewer.exe : fatal error LNK1120: 1 unresolved externals Any ideas?
  10. isenthalpic53

    Lighting problem

    yeah, lightmaps are for static lighting of an environment (although doesn't quake 2 basically do a dynamic lightmap for like the default blaster gun thing and such?) I believe you can have the world lit by a static lightmap and still have your headlights apply added lighting. You can also look into shaders and build a 'real' lighting model rather than doing GL's built in lighting and lighting hacks (light mapping is basically considered a lighting hack).
  11. isenthalpic53

    Lighting problem

    It seems you aren't re-normalizing the summed vector that is to be your normal. It also seems suspicious that you must recompute the triangle normals within the vertex normal computation code (don't you already store the triangle normals for other uses?)
  12. isenthalpic53

    Collision Response Woes

    Your problem is likely due to floating point errors. On top of what has been suggested, you should also compute a parametric value that is slightly less than the computed parametric value. I've never been able to get collision detection and response to work without post-processing the collisions and manually checking for penetrations.
  13. isenthalpic53

    introduction to fluid simulation?

    To piggy back on what has been said, I know a guy that was hired by an oil company in his graduate program to develop mathematical equations for the flow of crude through their pipelines, with the purpose of optimizing flow which cuts costs. One *single equation* in the analysis was roughly four pages long. This is not trivial stuff.
  14. isenthalpic53

    wxwidgets or mfc mdi opengl

    I don't believe you need to pay anything additional for MFC so long as you've got Visual Studio. I had headaches installing wxWidgets and getting their OpenGL examples to run without crashing. Developing elaborate GUIs with *either* is going to give you massive headaches, I promise you that. Like I said, unless you *really* need to have an elaborate GUI I'd just go with GLUT. Heck, when I've developed applications that only need limited interaction I just use pure Win32.
  15. isenthalpic53

    wxwidgets or mfc mdi opengl

    MFC isn't obsolete. There are regular updates and it is still in wide use in the commercial world. Both approaches are going to give you headaches. wxWidgets is cross platform, but you can quickly get started with MFC because the Visual Studio class wizards will add the code hooks when you add controls onto forms (at least with visual studio 2005). Unless you *really* need an elaborate GUI, I'd forgo both MFC and wxWidgets and use GLUT. That will give you enough functionality for buttons and controls. I'd only go with wxWidgets if you must have cross-platform functionality. If you are only shooting for Windows boxes MFC would be my suggestion.
  16. isenthalpic53

    MilkShape 3D, generic paths

    Hmm, I'm not entirely sure what you mean. As far as I know MS3D assumes that the texture is located in a folder relative to where the model itself is located, such that you can move the model and texture later on and use it in another application (e.g. one you're trying to write).
  17. isenthalpic53

    Rigid Body class design

    Quote: I just ran my code through Doxygen and posted the docs on my sourceforge page here. Cool, thanks for that. My employer just suggested Doxygen the other day, it's a really useful tool isn't it? Quote: We must have done similar things and I've read Dave Eberly's book and Baraff's paper. My implementation is not that different from his: quite similar except the fact that he hardcoded RK4 inside his RigidBody class... Aye, right on. I don't think that what you've written is over-engineered or overly-complex. It actually seems very similar to the untenable 'rigid body class standard' that everyone seems to adhere to. I'd just say this: keep up the good work and let us know when you solve any previously unsolvable problems! The only actual suggestion I have at this point falls in line with what Mr. Dickie said: I'd keep the rendering methods outside of the rigid body class. I keep my rendering in a renderer manager and pass information via a common interface.
  18. isenthalpic53

    Rigid Body class design

    Again, I'd like to see your equivalent definitions. That'd probably help give us ideas.
  19. isenthalpic53

    Rigid Body class design

    Quote: This is way too complicated, over engineered and abstract in my opinion. Make your rigid body class as *simple* as possible with some helper functions, like e.g. transforming points and vectors into the local body space and vice versa, applying forces and impulses. There is really no need for ll these indirections. Interesting. I'd like to see your Rigid body definitions, because I actually think of mine as somewhat over-simplified! It also seems that the differences between Agessera's definitions and mine are ultimately pretty small (considering how vastly different they could have been). The only functions I have that might be considered 'physics logic' only has to do with differential equation solving, and they're ultimately just place holders at that!
  20. isenthalpic53

    Check if a triangles is visible

    Then what you want is what Mr. Cableguy suggested: GL_ARB_occlusion_query. He didn't mention that this extension and its counterparts will indicate the number of pixels drawn (meaning if only one pixel from the triangle made it to the final scene you'll know about it). Quote: Also you would have to draw your geometry front to back. Hmm, now I'm questioning my memory...so if a number of pixels from the triangle are rendered successfully, but then overwritten in the color buffer later (hence fully occluding the object), the extension doesn't pick up on it?
  21. isenthalpic53

    Rigid Body class design

    I'd rather not reply with 'advice' as I can hardly say I'm an expert in this subject, but I have written a physics thing or two. Instead of giving advice, I'm just going to post my rigid body definitions. After a somewhat cursory overview of your code it seems that we've approached things similarly, but mine has a lot of extra 'stuff' added in. I was reading GamePhysics by Eberly when learning how to write mine. The PredictNewPositionandOrientation, force_and_torque and Convert functions all relate to solving the equations of motion. Nearly every object (in my code) uses an implementation of RK4 called from 'PredictNewPositionandOrientation(),' but simpler objects can use a simple Euler integration. The force-and-torque virtual method (I see you have force and torque 'generators') is used to calculate the intermediate steps of a diff. eqn. solver. These intermediate steps may also be referred to as 'curvature' functions (as forces and torques are basically derivatives of the equations of motion). This setup is to make it easier to write implementations of vastly different objects, e.g. Hovercrafts, air planes and cars (so far I've just written cheap ways to simulate air cushion vehicles and cars with suspension). Similarly with you I keep my RK4 implementation (and other solvers) outside of the rigid body class. #ifndef RIGID_BODY_H #define RIGID_BODY_H #include "Vector.h" #include "Matrix.h" #include "Quaternion.h" struct StateVector { Vector3 mPosition; Vector3 mLinearMomentum; Vector3 mLinearVelocity; Vector3 mAngularMomentum; Vector3 mAngularVelocity; Quaternion mQuat_Orientation; Matrix3x3 mMat_Orientation; Vector3 mEuler_Orientation; }; class RigidBody { public: RigidBody() { mMass = 1; mMassInv = 1; mRadius = 1.0f; mStiffness = 1; mStaticFriction = 1; mDynamicFriction = 1; } ~RigidBody() { } virtual void PredictNewPosAndOrientation(double DT) = 0; virtual void Force_and_Torque(Vector3 *force,Vector3 *torque,Vector3 & position, Quaternion & quat_orientation,Vector3 & linear_momentum, Vector3 & angular_momentum,Matrix3x3 & mat_orientation,Vector3 & linear_velocity,Vector3 & angular_velocity) = 0; virtual void TouchFunc(RigidBody *pOther, Vector3 & Normal, Vector3 & HitPoint)=0; //if NULL, then we hit the world void SetInertia(float Ixx,float Iyy,float Izz) { mJBody.mat[0][0] = Ixx; mJBody.mat[1][1] = Iyy; mJBody.mat[2][2] = Izz; if(Ixx != 0) mJBodyInverse.mat[0][0] = 1.0f/Ixx; else mJBodyInverse.mat[0][0] = 0.0f; if(Iyy != 0) mJBodyInverse.mat[1][1] = 1.0f/Iyy; else mJBodyInverse.mat[1][1] = 0.0f; if(Izz != 0) mJBodyInverse.mat[2][2] = 1.0f/Izz; else mJBodyInverse.mat[2][2] = 0.0f; } //p = linear momentum, l = angular momentum //R = output matrix orientation //V = output linear velocity //W = output angular velocity //The first three parameters converted to last 3, respectively void Convert(Quaternion & Q, Vector3 & P,Vector3 &L,Matrix3x3 & R,Vector3 & V,Vector3 & W); void ApplyImpulse(Vector3 & dMomentum,Vector3 & ContactPoint); //Applies LINEAR impulse only void ApplyLinearImpulse(Vector3 & dMomentum) { CurrentState.mLinearMomentum += dMomentum; } //Applies ANGULAR impulse only void ApplyAngularImpulse(Vector3 & dMomentum,Vector3 & ContactPoint) { CurrentState.mAngularMomentum += CrossProduct(&dMomentum,&ContactPoint); } void AddForce(Vector3 & Force,Vector3 & Location) //note that location must be in local coordinates { mForces += Force; mMoments += CrossProduct(&Location,&Force); } float GetMass() const { return mMass; } float GetMassInv() const { return mMassInv; } void SetMass(float IN); /* Constant physical properties */ float mRadius; //Radius that encloses all collision hulls of the body Matrix3x3 mJBody; //Inertia tensor in body coordinates Matrix3x3 mJBodyInverse; //Inverse inertia tensor in body coordinates (never changes) float mStiffness; //Used to calculate coefficient of restitution float mStaticFriction; float mDynamicFriction; /** DYNAMIC PHYSICAL PROPERTIES **/ StateVector CurrentState; /* Predicted states, filled in by the built-in differential equation solver */ StateVector PredictedStateVector; Matrix3x3 mJGlobal;//Moment of inertia in global coordinates //must update with orientation to be accurate, not really needed Matrix3x3 mJInverseGlobal; //This gets computed frequently, inverse mass moment of inertia //I made these private because changing one always requires a change in the other protected: float mMass; //Mass in KG float mMassInv; void RK4Update(double); }; StateVector GlobalRK4Update(StateVector &in,double DT); /* y(t + dt) = y(x) + dt*y'(x) + [dt^2 / 2!]y''(x) + [dt^3/3!]y'''(x) Linear: y(x) is current position y'(x) is velocity y''(x) is acceleration , or Force/Mass or Force * iMass */ /* Need to be able to: Convert Vector3D to a quaternion (implemented this, haven't tested it) Convert quaternion to an orientation matrix (implemented this, don't know if it works) Transpose a 3x3 matrix (just swap rows and columns, should be easy) (implemented this, tested it, seems to work fine) */ /* *A*: To compute global inverse mass moment of inertia tensor: -Integrate quaternion orientation (see note B) -Turn the quaternion orientation into a matrix orientation (R, a 3x3 matrix) -The inverse moment of inertia matrix in global space is: R * mInvInertiaTensor * R^T where R^T is the transpose of R -The angular velocity is the inverse moment of inertia matrix multiplied by the angular momentum vector *B*: The change in quaternion orientation with respect to time: dq(t) / dt = (.5)(w(t))(q(t)) where w(t) is the quaternion which represents the angular velocity */ #endif
  22. isenthalpic53

    OpenGL Text and texture problems...

    View in the gluLookAt function is supposed to be: gluView = Position + View_direction where ViewDirection is a unit vector that represents the vector you are looking at. So if you are just looking down the negative Z axis (this is OpenGL's default), and you are at the position x=10, y=0, z=0, then gluView is going to be x=10, y=0, z=-1
  23. isenthalpic53

    numerical spring solver

    Is using a method such as RK4 a poor choice for implementing a dampened spring? I've got a robust RK4 solver implemented such that in order to create a new physics object you simply need to write the object's 'derivative' function (e.g. the force and torque function in David Eberly's Game Physics book). This is done by overriding pure virtual methods in my RigidBody physics class. The problem is that when implementing this for a very simple dampened spring (which I've implemented in simpler cases in which stability was not an issue) I do not get the proper results. The current use is having an object 'trail' behind a vehicle (a simple hovercraft). The hovercraft's movements are updated using the same type of RK4 solver (but has it's own force_and_torque function), and I want the camera to follow behind it as if it were connected via a spring. There are no 'torsional/twisting' effects on the spring, e.g. it just applies the force in the proper direction to move towards the desired position. When using the simple Euler solver it basically works as youd expect, but because the Hovercraft is being updated with RK4 you get 'jitters' where the spring all of a sudden surges ahead to make up the difference over the past few thousand frames or so (the difference between the two solvers). Note that the Hovercraft's new position and orientation are resolved, and *then* the spring is updated. Perhaps I should be updating both simultaneously, making the spring surge towards each of the Hovercraft's intermediate positions? Perhaps that'd mean I've have to embed the spring code within the Hovercraft's force_and_torque function Whew, I really don't know if I'm making any sense. Anywho, here's the force and torque function for the dampened spring (note there is no torque). void CamSpring::Force_and_Torque(Vector3 *output_force,Vector3 *output_torque,Vector3 & position,Quaternion & quat_orientation, Vector3 & linear_momentum,Vector3 & angular_momentum,Matrix3x3 & mat_orientation, Vector3 & linear_velocity,Vector3 & angular_velocity) { StateVector & hover_state = pParent->CurrentState; Vector3 desired_pos = hover_state.mPosition + (hover_state.mMat_Orientation * mLocalPos); Vector3 sep = desired_pos - position; float sep_dist = sep.FastGetLength(); Vector3 sep_dir = sep; sep_dir.Normalize(sep_dist); Vector3 force = sep_dir * sep_dist * this->spring_k; *output_force += force; force.Normalize(); // DebugPrintVector("force",*output_force,gpTextManager); DebugPrintFloat("fds",DotProduct(&force,&sep_dir),gpTextManager); }
  24. isenthalpic53

    numerical spring solver

    Quote: in that it sounds like the "intermediate" hovercraft positions are not being used during the spring/camera update. Dear Mr. Rowl, you are absolutely correct about this, although with this particular system (spring and hovercraft coupling) the differences between the two approaches from an interactive standpoint are not noticeable. I did notice differences numerically, but they are negligible and the system does not explode. In your implementation(s), do you have all rigid bodies integrate inside the same, more 'universal' "IntegrateRK4" function? I do in fact have everything separate, unless they comprise the same system (e.g. the hovercraft air cushion is approximated by a circular array of dampened springs). Thank you for the response.
  25. isenthalpic53

    numerical spring solver

    Hi, I just wanted to come back and express thanks. The problem is basically solved. Part of the problem was orbiting around the desired camera position, and the rest of the problem has just been, as you both said, tweaking the K and dampen factors of the particular spring (so, there's otherwise nothing wrong with the solver).
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!