# Caesar

Member

304

126 Neutral

• Rank
Member
1. ## [CROSS POST] 3d artists needed

Hi, as a lot of you might not frequent the help wanted section, I'd like to draw your attention to a post from the help wanted section where we seek 3d artists for a World War I. aerial combat simulator. Feel free to visit the project webpage at http://urtax.ms.mff.cuni.cz/flyingsamurai. thanks
2. ## Curious about copy protection schemes (a.k.a CD Keys) ...

I'm no expert, but how about some hashing maybe?
3. ## Physics of ball - magnus force

Hi, I'm trying to simulate a soccer ball flight. I'd like to account for gravity and magnus force (I don't need to account for drag now). As far as I know, the Magnus force acts in a direction perpendicular to the direction of motion at every moment in time. Let's say there is only left/right spin on the ball generating the Magnus force. position += d * dt + cross(d, up) * some_appropriate_length; where d is the current direction vector, up is the up vector and some_appropriate_length is simply a length of the magnus force vector due to rpm and dt I believe. dt is the time step. Now, how would I go about a non-iterative function of time that would express the same stuff? The only idea I got was that since velocity is derivation of position and d * dt + cross(d, up) * some_appropriate_length; is my velocity, I could get the position by integrating (over dt I believe). The problem is I don't know how to integrate that cross product. I could try integrating the x, y, z separately, but then again I don't believe that would work (the values change, would I have to do a n-dimensional integral?). I'd also like to hear of any articles that also have some actual equations aside from principle discussion. I need that to be able to tell the rpm I need when I have an initial direction (velocity), a start point and a finish point (and don't take care of the altitude of the ball) (without using some kind of guessing, like bisection) thanks in advance
4. ## ballistic curve, iteratively

Okay, that seems to work fine (and also is easier to understand). Thank you! As to my handling of gravity, the difference was that instead of changing the speed vector every iteration by the acceleration, I added (negative 9.81) the gravity acceleration multiplied by time since launch. v += a * dt; p += v * dt; vs. p += (v + a * t) * dt and I believe my mistake was that instead, I used p += v * dt + a * t which is wrong. Thanks for your help.
5. ## ballistic curve, iteratively

hi, I've been trying to simulate a ballisti curve (want to simulate a ball). I have the elevation angle, the initial speed (in meters / second) and the initial position is 0, 0, 0. I have positive Z pointing up. int v = velocity; vector d = direction_from_elevation_angle(angle); vector position; vector gravity(0, 0, -9.81); int msec_since_start = 0; while(position.z >= 0.0) { time_delta = time_since_last_iteration(); msec_since_start += time_delta; position += direction * v * time_delta + gravity * msec_since_start; } but that somehow doesn't seem to work (I've tried it in C++... a mass point shot at 20 meters / s under 45 degrees hit the ground in less than 0.2 sec (rather messy code below). Any hints? I want to do it iteratively. Thanks for any hints. #include <stdio.h> #include <stdlib.h> #include <conio.h> float vx, vy, g, x, y, t; bool iterate(float t_delta) { t += t_delta; x += vx * t_delta; y += vy * t_delta - g * t; printf("t = %f: [%f;%f]\n", t, x, y); return y > 0; } int main() { x = 0, y = 0, vx = 0.707 * 20.0f, vy = 0.707 * 20.0, t = 0.0f, g = 9.81; while(y >= 0.0 && t < 10.0f) iterate(0.1f); getch(); return 0; }
6. ## Octree traversal for raytracing

also, you might want to see this thread http://www.gamedev.net/community/forums/topic.asp?topic_id=298074 I had had improved my kd-tree (kind of an octree, but you don't divide in halves, but instead where you think it's going to help the most) by a huge factor thanks to those guys. Ie it really matters (in such a tight loop) where you position ifs, etc. Don't have the code anymore though
7. ## Octree traversal for raytracing

Quote: if node is leaf: for all primitives: if ray intersects primitive: return true return false for eight child nodes: if child node and ray intersects child node's AABB: if ray intersects child node: return true return false First, it seems to me you are checking for ray/node collision twice, once against AABB and then against the node (presuming transformed BB). My opinion is you should keep the octree axis aligned and transform the ray instead (with the transformation inverse to that with which you'd transform the AABB). But maybe I got you wrong. Also, I assume you mean "for all primitives in that leaf".
8. ## projection matrix

Hi I'm rendering a 3d model and only now noticed that the matrix I thought was perspective was ortho (I'm trying to do all the matrix calculations myself). Ever since, I've been trying to plug in a perspective projection matrix, only to always get a somehow distorted (stretched along z sometimes). I've tried using gluPerspective, which I think works (I'm so confused now :) ), but I can't figure out what matrix it uses. I've tried using projection matrix from Irrlicht and from Real Time Rendering book (page 65), no good. thanks
9. ## 3ds and face cw/ccw

Only now that I read Yann L's post I get it. I need to compare the loaded normal with the one I compute and see if they're the same or not and depending on that, rearrange the vertices to go CW/CCW (the way I want them) thanks guys
10. ## 3ds and face cw/ccw

Oh, I see. The problem is I'm loading files I've downloaded from the internet and some have the vertex order messed up (CW instead of CCW) (I compute the normals myself instead of loading them). Also, I believe that while you can tell whether the face is CW or CCW, it depends on the actual point of view and thereby you'd need to know whether a certain tri should be facing you or not when you're standing at some specific point in space. Or did I get it totally wrong?
11. ## 3ds and face cw/ccw

hi how do I learn whether the vertices in a face in a 3ds file are in CW or CCW order? I know there's a faceflag for each flag, but don't think that's what I'm looking for (I enable back face culling to see whether the object is CW or CCW, but they all have the flag set to 7 (decimal). Any idea where to look? (I'm looking at lib3ds now, but haven't found it yet)
12. ## write bmp

http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html