Jump to content
  • Advertisement

Jernej.L

Member
  • Content Count

    455
  • Joined

  • Last visited

Community Reputation

106 Neutral

About Jernej.L

  • Rank
    Member

Personal Information

  • Role
    Programmer
  • Interests
    Business
    Programming
  1. Jernej.L

    sync area partitioning

    Has anyone considered a implementation of this? the graphics look promising: http://www.sciencedirect.com/science/article/pii/S0305054801000338
  2. Jernej.L

    sync area partitioning

    I asked for a suggestion on which algorythm to use to partition the world into these zones based on where players are, i understand the concept but not what algorythm is generally used to calculate these zones.
  3. What are you guys using to partition areas into sync areas based on players? i need to partition my players.. so that basically i prepare sync data for these areas and just pust the updates to people in one areas, now what are the most popular approaches? Thanks.
  4. Jernej.L

    convert left hand rotations to right hand

    Dude, can you decompose that into some kind of pseudocode? i have no idea how to calculate such a reflection matrix..
  5. I'm dealing with another game data, internally the angles are right handed quaternions, in my app when i use the quaternion to build a matrix i get totally wrong results - the angles seem to go along totally wrong axis (i think they also end up being mirrored, it's hard to tell from the messy result i get) So, what i need is, a way to convert a left hand quaternion to right hand matrix with correct angles. (the flipcode matrix+quaternion faq has failed me on this one ) Ok, the result of my usual quaternion to matrix routine gives me following: roll: a-ok! heading: flipped (goes the wrong way as if flipped on axis) pitch: flipped (goes the wrong way as if flipped on axis) can i somehow generate and multiply a matrix to fix for this error? (invert just specific angle components? )
  6. I don't wish to watch "topics", i want to watch forum >sections< that matter to me.
  7. I always had my own list of favorite forum sections.. can this be re-added to the forum again? There are a lot of forums in main view and most forums that i don't frequent there are just a big messy distraction to me.
  8. Ok, thanks to everyone, here's the final working version: function CreateGlRotateMatrix(angle, x, y, z: single) : TMatrix; var axis: TVector3f; b, c, ac, s: single; invLen : Single; begin angle:= vectorgeometry.degtorad(angle); invLen:= RSqrt(x * x + y * y + z * z); x:= x * invLen; y:= y * invLen; z:= z * invLen; result:= IdentityHmgMatrix; c:= cos(angle); s:= sin(angle); result[0,0] := (x*x) * (1-c)+c; result[1,0] := x*y * (1-c)-z*s; result[2,0] := x*z * (1-c)+y*s; result[0,1] := y*x * (1-c)+z*s; result[1,1] := (y*y) * (1-c)+c; result[2,1] := y*z * (1-c)-x*s; result[0,2] := x*z * (1-c)-y*s; result[1,2] := y*z * (1-c)+x*s; result[2,2] := (z*z) * (1-c)+c; end; This finally matches the game's map files to build a proper matrix, it uses this with some "odd" quaternion conversion routine, which i couldn't reproduce with any other quaternion to matrix algorythm on the internet: // preprocess quarternion rotations X := rx; Y := ry; Z := rz; W := -rw; S := Sqrt(1.0 - W * W); // divide by zero if not (S = 0) then begin Axis[0] := X / S; Axis[1] := Y / S; Axis[2] := Z / S; Angle := 2 * geometry.ArcCos(W); if not (Angle = 0) then begin rotang:= CreateGlRotateMatrix( Angle * 180 / Pi, Axis[0], Axis[1], Axis[2]); glMultMatrixf(@rotang[0,0]); //glRotatef(Angle * 180 / Pi, Axis[0], Axis[1], Axis[2]); end; end; But this only works on game file quaternions. If i use this on the game's quaternions from the memory i get some strange results, i'll post that as another question if i can't figure it out soon :S
  9. Ok, i tried normalizing the vector & transposing / not transposing but still no luck, here's new function i have: function CreateGlRotateMatrix(angle, x, y, z: single) : TMatrix; var axis: TVector3f; b, c, ac, s: single; invLen : Single; begin invLen:= RSqrt(x * x + y * y + z * z); x:= x * invLen; y:= y * invLen; z:= z * invLen; result:= IdentityHmgMatrix; c:= cos(angle); s:= sin(angle); result[0,0] := (x*x) * (1-c)+c; result[1,0] := x*y * (1-c)-z*s; result[2,0] := x*z * (1-c)+y*s; result[0,1] := y*x * (1-c)+z*s; result[1,1] := (y*y) * (1-c)+c; result[2,1] := y*z * (1-c)-x*s; result[0,2] := x*z * (1-c)-y*s; result[1,2] := y*z * (1-c)+x*s; result[2,2] := (z*z) * (1-c)+c; // vectorgeometry.TransposeMatrix(result); end; I can show some screenshots of the working (glrotatef) & non-working results (CreateGlRotateMatrix) if that would help in any way clear the situation on what's wrong with it.
  10. Ok thanks, based on that i wrote this function (sorry for pascal syntax): function CreateGlRotateMatrix(angle, x, y, z: single) : TMatrix; var axis: TVector3f; b, c, ac, s: single; begin result:= IdentityHmgMatrix; c:= cos(angle); s:= sin(angle); result[0,0] := (x*x) * (1-c)+c; result[1,0] := x*y * (1-c)-z*s; result[2,0] := x*z * (1-c)+y*s; result[0,1] := y*x * (1-c)+z*s; result[1,1] := (y*y) * (1-c)+c; result[2,1] := y*z * (1-c)-x*s; result[0,2] := x*z * (1-c)-y*s; result[1,2] := y*z * (1-c)+x*s; result[2,2] := (z*z) * (1-c)+c; end; The results aren't what it's supposed to be: I replaced: glRotatef(Angle * 180 / Pi, Axis[0], Axis[1], Axis[2]); With: rotang:= CreateGlRotateMatrix( Angle * 180 / Pi, Axis[0], Axis[1], Axis[2]); glMultMatrixf(@rotang[0,0]); The results make a total mess when objects are rendered, none of rotations look correctly, did i get the matrix array addressing right? in delphi the matrix order are row-col based.
  11. I'm not very skilled with math, but i'm wondering what does glRotatef do internally? I have some legacy code which does some math i don't really understand and sends values to glRotatef. I am implementing a physics engine to go with this legacy code and i need a 4x4 matrix instead of that output, i don't really understand how the rotation along a vector glrotatef thing works, but i just need a resulting matrix - which if i multiplied with glMultMatrixf instead of glrotatef would result in same working output. Thanks.
  12. Jernej.L

    Texture atlases & texture bleeding

    O_o the dude just used HALF the size more of texture.. does saving few miliseconds per a texture bind justify wasting this amout of data?
  13. Jernej.L

    Texture atlases & texture bleeding

    How much does it need? is there any optimal range on how many pixels get interpolated and this is standard across all hardware? I'd really hate to have to fix this later on during development.. is there no better way? with this i'd lose a lot of empty space between textures..
  14. I'm trying out texture atlases, but i'm stuck at one last issue.. The texture clamping is not useable tool to stop textures from bleeding from one to another or into surrounding pixels of the texture - what do you people do solve this problem with texture atlases?
  15. Jernej.L

    how much do you know about China?

    Quote:Original post by frankst N korea doesn't have any chance to use the bomb if some countries leave them alone. I find this quote interesting, i thought everyone was trying to leave north korea alone / isolated, so why do they need nukes for? Purely for recognition as a superpower? is kim jong il really so crazy to invest resources into nuclear weapons and and bragging rights than feeding the nation he's supposedly leading?
  • 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!