deavik

Members
  • Content count

    813
  • Joined

  • Last visited

Community Reputation

570 Good

About deavik

  • Rank
    Advanced Member
  1. Hey there, I bought a netbook recently which came with Windows XP on it... but I installed Linux on it since I only use it to check email and stuff Linux works great. No windows required. I also bought a desktop from Dell with no OS preinstalled, and am currently running Windows 7 RC on it. I was wondering if I can legally use my Windows XP license that I got with my netbook, on my desktop (and remove it from my netbook) and then avail of the Windows 7 upgrade (which is 50% off right now). I read online about people getting money back from Dell after removing Windows from their computers because they did not use it. So this should be possible right? I know this is a very specific Windows related question, but I thought some people here would probably know the answer. Thanks!
  2. Oh wow yea, that was a simple fix, thanks Ysaneya. I'd totally forgotten that texture coordinates over 1 were allowed. :-/ Quote:Original post by deavik I found this online: link. Is this a way people do terrain texturing? It seems easy, except for how exactly to blend the detail map. I just wanted to know if there are any de facto easy methods that I just haven't heard of. Thanks! If anyone has any input about general terrain texturing methods though, I'd be happy to learn about it. :)
  3. Hi, I have a beginner question: how to put textures on a terrain. My first (naive) approach was to tile a "grass texture" across all of my patches like this: for (int y = 0; y < numVertsY; ++y) { for (int x = 0; x < numVertsX; ++x) { ... texCoordArray[indexOffset(x, y) * 2 + 0] = (x % PATCH_SIZE) / (float) PATCH_SIZE; texCoordArray[indexOffset(x, y) * 2 + 1] = (y % PATCH_SIZE) / (float) PATCH_SIZE; } } This doesn't work at the borders between patches, for obvious reasons: eg. if PATCH_SIZE is 8 (x%8)/8 will never be 1. Also, it looks jittery and crappy far away because of the minification (if that makes sense), as in the screenshot I found this online: link. Is this a way people do terrain texturing? It seems easy, except for how exactly to blend the detail map. I just wanted to know if there are any de facto easy methods that I just haven't heard of. Thanks!
  4. Linking GLFW with VS2008 on Vista x64

    I remember doing this recently. I had to make sure the runtime library was the same for both my project and GLFW. Go to Project properties > Configuration properties > C/C++ > Code generation and check what runtime library your project is using. (Mine was /MDd for example) Now in the GLFW src, go to lib/win32, open Makefile.win32.msvc and add /MDd to the front of CFLAGS and CFLAGS_SPEED. And the same for the examples (there is a different Makefile for those).
  5. Hello there! I've spent the past few days messing around with ODE, getting a heightfield / capsule collision detection working. I have a simple scenario with just 2 geoms, the capsule and the heightfield. For some reason, if I call dCollide with the 2 geoms every physics step, I get a more or less stable simulation. However, if I use dSpaceCollide, leaving everything else the EXACT same, I get my character wildly bouncing around. I am using a fixed time step (atleast, I'm doing this:) accumulatedTime += dt; // add the time the current frame took (t-t0) // do as many steps as required (maybe even 0) while (accumulatedTime > stepSize) { dSpaceCollide(space, NULL, &nearCallback); dWorldQuickStep(world, stepSize); dJointGroupEmpty(contactGroup); accumulatedTime -= stepSize; } Does anyone know how to tackle such a problem? I'm thinking that dSpaceCollide is not calling dCollide on my object aptly enough, resulting in large penetration depths and equally large rebound forces. - How do you bound these rebound forces? - or ideally make it "move" the capsule to handle collisions, instead of using dynamics and forces. Here's my nearCallback (almost identical to the ODE manual): void nearCallback(void* data, dGeomID o1, dGeomID o2) { if (dGeomIsSpace(o1) || dGeomIsSpace(o2)) { // colliding a space with something : dSpaceCollide2(o1, o2, data, &nearCallback); // collide all geoms internal to the space(s) if (dGeomIsSpace(o1)) dSpaceCollide((dSpaceID) o1, data, &nearCallback); if (dGeomIsSpace(o2)) dSpaceCollide((dSpaceID) o2, data, &nearCallback); } else { if (o1 == o2) return; dContact contacts[Physics::MAX_CONTACTS]; for (int i=0; i<Physics::MAX_CONTACTS; ++i) { contacts[i].surface.mode = dContactBounce; contacts[i].surface.mu = 0; contacts[i].surface.bounce = 0; } int numContacts = dCollide(o1, o2, Physics::MAX_CONTACTS, &contacts[0].geom, sizeof(dContact)); for (int i=0; i < numContacts; ++i) { dJointID c = dJointCreateContact(Physics::world, Physics::contactGroup, &contacts[i]); dJointAttach(c, dGeomGetBody(o1), dGeomGetBody(o2)); } } }
  6. Thanks for the info... I think I'll just loop through the indices and make new arrays, so that effectively my index array will be 0, 1, ..., n-1
  7. Hi, I just started working with OpenGL again after a really long time, and I was trying to display some md2 files: spec here. My question is: is it possible to use different indices for the vertex and texCoord arrays, or do they use the same indices? (I know that the indices are specified in the glDrawElements command and you seem to specify them all at once). The MD2 file has separate indices for vertices and texCoords in the Triangle structure, and it would be really easy to use vertex arrays if you could specify different index arrays. That's why I was wondering. Thanks! [Edited by - deavik on May 10, 2009 11:24:49 AM]
  8. ODE dBodyGetRotation results in shear

    Quote:Original post by grhodes_at_work Interesting...I've had problems with the quaternion version of ODE object orientations becoming inconsistent, but the dBodyGetRotation results always seemed fine. What you said gave me an idea, so I instead used dBodyGetQuaternion, converted to a matrix with my own code and now it works. I know that doesn't really address the problem... and unless I've done something incredibly stupid I think there may be a bug in the runtime somewhere. I'll keep looking.
  9. Hello everyone, I've been trying to do some stuff with ODE (Tao.Ode, ode version 0.6 I think) and have been having some problems with it. dBodyGetRotation returns a 3x4 (or 4x3?) matrix which somehow results in me getting a shear on the model I am rendering (a box) instead of a rotation. For debug I printed out the output of dBodyGetRotation so here it is: 0.7642459 0.01327106 0 0 -0.01014324 0.999912 0 0 0.6448452 -9.313226E-10 -1 0 in the order 0 1 2 3 4 5 6 7 8 9 10 11 - is this all right as a pure rotation matrix for the 3x3 part? - if it is I guess I am messing up how I make a model matrix from it. I am using OpenGL and Cg and I just put those floats as the first 12 elements of the matrix, add translation to elements 3,7 and 11 and then give it to Cg as a row major cgGLSetMatrixParameterfr matrix. I would appreciate any help, thanks!
  10. [Solved] Tao.Ode TriMesh problem

    Well I said I was new to Ode and I definitely have a lot to learn :) Ode doesn't make a copy of the TriMesh data, and the pointers you give it have to remain throughout the running time of the app.
  11. Hello all, I was just trying to get to know Ode a little more with the wonderful Tao.Ode. I got a simple box falling under gravity and colliding with a plane (Ode plane). But then I tried to replace that with a trimesh containing 4 triangles and I'm having lots of problems. - My box bounces once and then "falls through" the trimesh. The number of contacts return by dCollide becomes 0 when this starts. Here is my "NearCallback" function: static private void NearCallback(IntPtr data, IntPtr o1, IntPtr o2) { IntPtr b1 = Ode.dGeomGetBody(o1); IntPtr b2 = Ode.dGeomGetBody(o2); Ode.dContact[] contacts = new Ode.dContact[4]; //max of 4 contacts Ode.dContactGeom[] contactGeoms = new Ode.dContactGeom[contacts.Length]; int numContacts = Ode.dCollide(o1, o2, contactGeoms.Length, contactGeoms, Marshal.SizeOf(contactGeoms[0])); Console.Write("{0},", numContacts); for (int i=0; i<numContacts; ++i) { // set surface contact parameters contacts[i].surface.mode = (int) (Ode.dContactFlags.dContactBounce|Ode.dContactFlags.dContactSoftCFM); contacts[i].surface.mu = Ode.dInfinity; contacts[i].surface.mu2 = 0f; contacts[i].surface.bounce = 0.01f; contacts[i].surface.bounce_vel = 0.1f; contacts[i].surface.soft_cfm = 0.01f; contacts[i].geom = contactGeoms[i]; IntPtr joint = Ode.dJointCreateContact(worldId, contactGroupId, ref contacts[i]); Ode.dJointAttach(joint, b1, b2); } } - I get segfaults (at first I thought they were random, now it crashes consistently after collision): Stacktrace: at (wrapper managed-to-native) Tao.Ode.Ode.dCollide (intptr,intptr,int,Tao.Ode.Ode/dContactGeom[],int) <0x0000e> at (wrapper managed-to-native) Tao.Ode.Ode.dCollide (intptr,intptr,int,Tao.Ode.Ode/dContactGeom[],int) <0xffffffff> at glfwtest.App.NearCallback (intptr,intptr,intptr) [0x0001e] in /mnt/home/src/dotnet/glfwtest/src/Main.cs:367 at (wrapper native-to-managed) glfwtest.App.NearCallback (intptr,intptr,intptr) <0xffffffff> at (wrapper managed-to-native) Tao.Ode.Ode.dSpaceCollide (intptr,intptr,Tao.Ode.Ode/dNearCallback) <0x0000e> at (wrapper managed-to-native) Tao.Ode.Ode.dSpaceCollide (intptr,intptr,Tao.Ode.Ode/dNearCallback) <0xffffffff> at glfwtest.App.RunPhysics () [0x00000] in /mnt/home/src/dotnet/glfwtest/src/Main.cs:405 at glfwtest.App.Main (string[]) [0x000d5] in /mnt/home/src/dotnet/glfwtest/src/Main.cs:142 at (wrapper runtime-invoke) glfwtest.App.runtime_invoke_int_string[] (object,intptr,intptr,intptr) <0xffffffff> Native stacktrace: /usr/bin/mono [0x52e45d] /usr/bin/mono [0x4f643e] /lib/libc.so.6 [0x2b2d5cc13120] /usr/lib/libode.so(_ZN6Opcode11OBBCollider8_CollideEPKNS_14AABBNoLeafNodeE+0x4c6) [0x2aaab4b91726] /usr/lib/libode.so(_ZN6Opcode11OBBCollider8_CollideEPKNS_14AABBNoLeafNodeE+0x16f5) [0x2aaab4b92955] /usr/lib/libode.so(_ZN6Opcode11OBBCollider7CollideERNS_8OBBCacheERKN8IceMaths3OBBERKNS_5ModelEPKNS3_9Matrix4x4ESC_+0x120) [0x2aaab4b95e60] /usr/lib/libode.so(_Z11dCollideBTLP6dxGeomS0_iP12dContactGeomi+0x13a8) [0x2aaab4b6ead8] /usr/lib/libode.so(dCollide+0xeb) [0x2aaab4b275ab] [0x4028ca60] ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= I'm confused as everything worked fine when the geometry was a plane created with dCreatePlane. Oh, and for debugging I called dGeomTriMeshGetTriangle for every triangle and the vertices are correct. I would much appreciate some tips, as the code that changed from plane->trimesh was minimal and I don't know where something could have gone wrong. Thanks! [Edited by - deavik on January 4, 2008 1:18:02 PM]
  12. It works again! Thanks for the tips Nagromo, I still don't know exactly why it was being weird but here's what happened: I unplugged everything, put the battery in and locked it in place (there is a second latch for the battery, maybe that had something to do with it). Then I plugged in the AC cord and booted up. Next I unplugged the AC with the computer running, and it still ran but did not charge when plugged in and was showing 4 hrs of battery life left (impossible with my battery/laptop). So I went ahead and rebooted, with just the battery. It booted, and now it showed me 1 hr 43 min left (about right). Then I plugged in the AC again, and the charging LED lit up, and everything was golden!
  13. Hey Programmer One, thanks for the answer! It's actually a Li-ion battery, I should have mentioned that sorry. But I don't actually think the battery got really wet... just wettish on the surface (there wasn't much moisture near the contacts at any rate). I actually think it was me taking the battery out while it was on that may have done some damage... is that possible? The computer runs fine (I'm using it now!) with AC plugged in... but a battery would be nice :)
  14. Hey everyone, Long story short, I was carrying my laptop in my backpack yesterday when it started pouring on my walk back from campus. Everything got slightly wet, and, dumbass that I am, the first thing that I tried when i got home was to...turn it on. Weird things happened like the screen was very very dim, power button didn't work, so I got nervous that I couldn't turn it off (but I should) so I did something even worse, I took the battery out. Then I calmed down and let it dry overnight (don't know if that did anything) but this morning it will turn on with the AC cord plugged in, but not with the battery. I'm pretty sure, based on the evidence of my post, that other people will know better what's exactly wrong, and maybe how to fix it, and so there is my plea for help! This was one of those cheap-o NASCAR branded AOpen 2000 notebooks, and support is laughable. There is 1 said battery selling right now for a relatively cheap price. Should I buy it, or is my battery salvageable? Thanks so much for any help! -Clueless [Edited by - deavik on July 28, 2007 10:11:04 AM]
  15. Quote:Original post by n00body Unfortunately, the support here for Cg isn't much better. The best I can offer from what I've seen is a link to a tutorial on multi-texturing in Cg. It shows two valid ways to do it, so I think either one will work for you. http://www.codesampler.com/oglsrc/oglsrc_10.htm#ogl_cg_multitexture That was a nice pointer, thanks n00body... but unfortunately to use the "Cg" way it shows it uses cgGLEnableTextureParameter, for which you need a Cg program parameter (as opposed to effect parameter). Using a CgFX file, I don't have that... I wish the functions would work as in the spec... or maybe i'm making a mistake which I can't identify because there aren't more examples...