# Jeremy6996

Member

42

120 Neutral

• Rank
Member
1. ## Need a bit of help merging both animations and the physics engine.

Thanks rumblesushi, I've decided instead of using points to describe the position of the bones in a given frame, I'll use rotation. This allows me to use the AngleJoint in the physics engine to move them to where they must be. So now a key frame will describe how a bone must be rotated by the time it's finished, which is preferable as the relative rotation of a bone is more predictable than the absolute position of a point in a bone. The problem I was having with the origin is: the physics points & bones are not contained in any sort of body and thus I can get the position of say a joint in the 'body', or a bone in the 'body', but of all the bones and points what actually defines the center of the physical body? I solved this by welding a point(0,0) to a defined 'anchor point' so that when that anchor point moves so does the center point welded to it and thus the so called 'position' of the body will change aswell. Sorry this is hard for me to explain :X I really appreciate the help from you and all those who came across my thread. I've solved the problem, thanks.
2. ## Need a bit of help merging both animations and the physics engine.

Alright, so I have a single physical body which consists of a series of points and bones which ultimately represent a charachter skeleton. This skeleton is registered in the physics engine(I'm using Farseer Physics). Each physical body can have numerous animations which consist of keyframes. These key frames give the position the points in the physical body must match at the time the frame has finished(I use linear interpolation to get the vertices where I want them over a period of time to give it a smooth effect). The primary problems come into play when: A) Farseer Physics (AFAIK) requires the joints have absolute position, so how do I translate the relative positions in the key frame to their corresponding absolute positions in the world if I have no origin to work off of? B )I don't want my animation system to fight with my physics engine; how is this handled if an incomplete animation can cause the game to look kind of ugly.
3. ## Design flaw, help.

Alright, thanks. Sorry, I wasn't sure if it was an acceptable practice. Phew, was afraid I was in for a big rewrite!
4. ## Design flaw, help.

I think I may have made a really big mistake in my game engines design and I need a bit of help fixing it. Here's my situation: What I've done is wrapped XNA in a module called "GraphicsAPI" which would, simply put, wrap the api incase I later decided to switch to OpenGl, DirectX, etc... Overtop of that module I have my graphics engine which provided a child-parent node way of organizing graphics, it also manages loading of graphics models and a couple other functions. All my modules share a math library (Wrapper for that provided by XNA), so that no conversions need to take place when the graphics module needs to send, ie, a vector over to the game engine. So as it stands, my game engine module does not have any knowledge or access to any XNA components and is using the common math library for vectors and matrices. The problem comes in when: Most C# physics engines are dependent on XNA, it would be really messy to have the game engine use the XNA framework and continuously convert my Math library vectors to XNA vectors. I'm thinking maybe I can have the physics engine work closely with the graphics api wrapper, but that too sounds like a pretty messy idea. Thanks.
5. ## 3D elements in a 2D environment.

I'm interested in creating a game with a map system similar to that of FF7. Where the environment is primarily 2D. With some 3D elements(such as characters). I've written an isometric engine before, but I'm not sure if an isometric engine is sufficient or too much. I just can't figure out how collision would work. Here's a ss of FF7's mapping system: http://bulk2.destructoid.com/ul/137223-barr.jpg Notice 2D environment(which looks 3D), and 3D characters & a couple scene elements.
6. ## Looking for a basic physics book sutiable for a GR10 math student.

Thank you all for your suggestions. I think I've found a good book, but I don't want to advertise it until I'm sure it is sufficient. I'm reading through it now, and I'll post regarding what I think of it most likely next week.
7. ## Looking for a basic physics book sutiable for a GR10 math student.

Thanks. I am reading into vector-mathematics and trig and I find it is helping my understand a lot more. I'm still trying to find a good physics book though.
8. ## Looking for a basic physics book sutiable for a GR10 math student.

Quote:Original post by grhodes_at_work Can you say which books you tried reading before? I was going to offer some advice, but I realized I might be pointing you to something you've already tried. I don't necessarily believe you'll find something that meets all of the needs you list perfectly, but if we know what didn't work for you, maybe we can offer something else. One more question...you said you have studied some linear algebra, and some trig....what about basic geometry other than trig? What about calculus? Anything at all? I remember studying geometry in 7th grade and calculus in 11th grade, and like you will be doing I first studied physics in 11th grade...but I don't know where things are now really. Yes, I've done some 2D geography in math class. As far as 3D geography is concerned, I have an OK understanding of the subject, which was self-taught after working with 3D graphics. We've done basic slope(I.e y = mx + b and Ax + By + C = 0). Translations, rotations, and scaling in 2D space. (I understand yaw-pitch-roll, the matrix multiplication pattern, but haven't the slightest clue how a matrix object works, I've been using APIs to create 3D rotations and translation matrices). I've tried O'Riley Physics For Game Developers, but was confused while it was explaining quantities(Which is the first chapter XD). It began to talk about the dot-product of two vectors(which we've not covered in GR10), and using symbols(not variables, but for example a large italic I or L looking symbol in the middle of the expression) which've not been explained. Sorry for being so vague. The book gives me the impression it was made as a reference(or for someone to expand) on their physics knowledge before taking courses in a post-secondary education course. I haven't done any calculus courses just yet.
9. ## Looking for a basic physics book sutiable for a GR10 math student.

I've procrastinated writing the physics engine for my game a while now. It's not that I don't find the topic interesting, I DO want to learn about physics, and I am taking a physics course next year. I've tried purchasing and reading two different physics books, but I don't understand anything past the first chapter. This is mostly due to the terminology used, and the unexplained symbols in the formulas. I want to find a book which : A ) Assumes they're dealing with a GR10 math student(I.e, not presenting weird symbols in formulas, and expecting the reader to understand them. Like a big italic 'L' looking symbol in the middle of an expression.) B ) Will prepare me for next-year's physics course(which is Physics11, there is no physics10, so this will be my first physics course). C ) Will be applicable to writing a physics engine. In grade ten we understand linear algebra, some trig(though I did some of this in grade 9, we still haven't covered it in GR10 math just yet. I would need a refresher on the basics of trig). Well, tbh, I can't recall everything we are taught in GR10, there's probably a list that I can get\make for you. I know it's probably difficult to find such a book, but I don't want to make use of a pre-existing physics engine, as the whole point of writing my game engine is to gather experience in the areas of game development.
10. ## Help understanding trilinear interpolation formula

Quote:Original post by haegarr Quote:Original post by Jeremy6996 I need to perform trilinear interpolation between two 3 dimensional vectors in my vertex shader.Are you sure you actually mean tri-linear interpolation? A linear interpolation is done between 2 values (w/o restricting "values" to scalars here, i.e. they can be vectors, too). A bi-linear interpolation is a linear interpolation of 2 already linear interpolated values. And a tri-linear interpolation is a linear interpolation between 2 already bi-linear interpolated values. That said, a tri-linear interpolation is done using 8 values (2x2x2). Now, you actually have 6 scalar values due to 2 3D vectors. Even if these 6 velues are uncommonly organized in 2 3D vectors (I mean uncommonly w.r.t. the scheme described above), there would be a lack of 2 values. Hence you probably just want to perform a linear interpolation of 2 3D vectors. Assuming that the vector is defined in Cartesian space, this means to do 3 independent linear interpolation between the 2 scalars of each dimension. Yeah, sorry, I was doing some wiki-ing, and I got confused when it said something about trilinear on 3 dimensional vectors. Linear is what I'm after. Thanks. pu = p0 + u(p1 - p0) So(pseudo code) float[] vec1 = float[3]; float[] vec2 = float[3]; float[] interpolatedVec[3]; for(int i = 0; i < 3; i++) interpolatedVec[i] = vec1[i] + fAmount(vec2[i] - vec1[i]);
11. ## Help understanding trilinear interpolation formula

I need to perform trilinear interpolation between two 3 dimensional vectors in my vertex shader. I haven't been able to find well explained formula for doing this. If someone doesn't mind linking me or giving me a brief explanation, that would be appreciated. Up to this point I've just been using the Lerp routines in the vectors. Thanks
12. ## Camera system, rotating an object regardless the camera

Quote:Original post by Kapoef some1 very smart told me once that the order that u multiply the matrices are important. It is. The multiplication order of a matrix is ISR(O)T Matrix Identity * Scale * Rotation * (Origin Matrix) * Translation D3DTS_WOLRD tells D3D to set the world transformation in (I assume) the vertex-shader. In XNA we have no default shader, I'm not sure about DirectX, but you must be using one in some form or way. Just as D3DTS_VIEW sets the view transformation. This is the orientation of your "camera" view. D3DTS_PROJECTION sets the projection matrix which describes how everything should be rendered. I.e aspect ratio, near-plane, far-plane, etc is held here.