![]() |
Fixing tacho band and needles in HUD - Printable Version +- Forums (https://www.vdrift.net/Forum) +-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4) +--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9) +--- Thread: Fixing tacho band and needles in HUD (/showthread.php?tid=733) Pages:
1
2
|
Fixing tacho band and needles in HUD - rookie1 - 07-20-2007 I'm trying to fix the missing tacho band and needles in HUD. My change is in revision 1777. It's not working yet. What I have done is added a function UTILITY: ![]() ![]() Code: SCENENODE &rotatenode = parentnode->AddNode(); I've only changed the tacho band drawing code to test this new function. But it seems the rotation has no effect at all. Is my use of scenenode and transformation correct? - joevenzon - 07-20-2007 Hmm... that looks correct to me. I'll have to take a look at this more later to figure out what's going on. Try rotating on the Z axis instead of the Y. - rookie1 - 07-20-2007 I've tried both Y and Z axis, same result. - joevenzon - 07-20-2007 Okay, I fixed this in R1778. Turns out I wasn't bothering to transform 2d scenegraph elements when they're drawn inside the GRAPHICS class. Note that if you want the rotation to be about a specific point (such as the center) you should build the 2d rectangle about 0,0,0 then add the rotation and translation. - joevenzon - 07-20-2007 Okay, R1779 should work as you'd expect. You can use the Draw2DRotation function like normal now. Be aware, though, that I removed the transform node, and instead just transform the vertices manually when the object is created. This should actually be faster, because the object is only created once (if you draw it every frame), but was kind of just an arbitrary design decision. - joevenzon - 07-20-2007 In R1780 I changed Draw2DRotation to be just another overload of Draw2D instead, so be aware. - rookie1 - 07-21-2007 Thanks Joe. I went ahead and fixed the tacho band, red band and all the needles in HUD now (r1781). ![]() - joevenzon - 07-21-2007 Thanks! - xTs - 07-21-2007 Nice thing. thanks! ![]() - kidrock - 07-25-2007 Yay now i can drive manually! (kind of hard to do so with no visual or sound)(when is sound going to be fixed on PPC anyway?) 99 (one more to 100) ![]() ![]() - bugsyv - 07-27-2007 kidrock Wrote:Yay now i can drive manually! (kind of hard to do so with no visual or sound)(when is sound going to be fixed on PPC anyway?) Interesting... you can use the application? PPC? OSX 10.4? What kind of video card do you have? Since the fix to the tacho needles, all my menus are offset in the y direction by half a screen. And the cursor won't move off the bottom edge of the screen. I'm not absolutely current, but by looking at the logs, this issue doesn't seem to be addressed. Anyways, I was planning on investigating after I finished some build-system stuff, but I am trying to figure out why this behavior hasn't been reported yet. - joevenzon - 07-28-2007 Quote:all my menus are offset in the y direction by half a screen If you don't figure it out, can you post a screenshot? - bugsyv - 07-30-2007 Well... I've got a fix, but I can't say I really "figured it out". It doesn't make much sense to me. The problem is that on my machine, VERTEX::Set(const VERTEX&) doesn't seem to work reliably. The funny thing is when I tried to inject printfs to see exactly what was happening, the particular display I was investigating would magically correct itself. It doesn't matter what the printf was. if I change the implementation from Code: memcpy(&x, &(other.x), sizeof(float) * 3 ); Code: x = other.x; ![]() The only thing that I can come up with is that many there is some bug in my memcpy implementation or it is configure to run asynchronously or something ( crazy talk, I know ). Anyways, I was wondering if there is any objection to checking this in. I would conditionally compile it, but I can't think of what to switch on. - joevenzon - 07-30-2007 Maybe on your platform it wasn't putting x at the beginning of the data. The reason I use memcpy is because it's faster than three assignments, and this function gets called a LOT. Can you try changing it to something like this: Code: memcpy(this, &(other), sizeof(VERTEX) ); - bugsyv - 07-31-2007 I had thought the order of members in the class might have been a cause, but that wouldn't explain the printf statements correcting the problem. In any case, your suggestion also seems to solve the issue. I had figured the implementation was a performance enhancement and is why I did not check in my fix immediately. Anyways I got to wondering about which approach would actually be faster... surely, function call overhead would negate any performance benefits fancy assembly code in memcpy got you. However, I ran some tests, and over 1 billion iterations the memcpy is 2 seconds faster than the three assignments ( 23 vs 21 ) on my machine. So... I was wrong. Anyways, I'll leave the code change in my local copy until the repository is updated. Thanks! |