15,682 reputation
23263
bio website sam.zoy.org
location Paris, France
age 35
visits member for 3 years, 1 month
seen 6 hours ago

I live in Paris, France.

I work on video games (computers and consoles) for a living. I write free software and all kind of crazy shit for fun. My interests: image processing, video coding, rendering, game development, maths, physics, compression, cryptography.


2d
comment Relative Position/Rotation calculation
Almost everything is wrong in here. All lines mentioning someUnknownMatrix have the wrong multiplication order, and one even inverts the wrong matrix. And the last part ignores the impact the rotation has on the relative translation.
Apr
14
comment OpenGL: glRotatef cause performance drop while rotating -x and -y
glRotatef will cause performance drops, period. It’s been superseded by better mechanisms for 10 years and deprecated for 6 years now. You should learn yourself some modern OpenGL instead.
Apr
2
comment Having trouble setting color in fragment shader
You can divide integers, but in GLSL, as is the case in C, C++ and many other languages, the result of 127 / 255 will be 0.
Mar
27
comment Compute world position by walking N units along spline?
You should fix your variable names. If Distance is the alpha value, why not call it Alpha? And… what is Alpha, then?
Mar
26
comment What is Vector Projection and what is it's use in games?
“Couldn't find a clear enough answer on Google.” Really? The first Google hits for me include vector projection in game development, vector projection in a maths tutorial, and vector operations for game programmers. Have you read them?
Mar
25
comment Which Unreal Engine 4 project files can I ignore in source control?
Yes, the engine needs a lot of modifications, and upstream UE is regularly merged into the repository.
Mar
24
comment How do I lerp between values that loop (such as hue or rotation)?
Dividing a vector by its length is called normalization. It ensures it has length 1. The len ? len : 1.0 part just avoids a division by zero, in the rare case that the mouse is placed exactly at the joint position. It could have been written: if (len != 0) dx /= len;.
Mar
23
comment Compute cone angle (cos) given side and hypotenuse vectors at time 0 and world matrix at time 1
If your tests show no difference between Transform and TransformNormal, you are not testing enough :-) Try adding a translation part to your tranformation matrix.
Mar
22
comment Calculating the point(s) at which two moving objects are a certain distance from each other
Just a note: the code would be simpler if you did veld = e1.vel - e2.vel and used that variable everywhere instead of p, r, q and s.
Mar
8
comment From Position/Target to Orientation/Elevation
I suppose you mean 2.6e-06. That is perfectly normal when doing computations with floating point numbers. You can get slightly better precision using double instead of float, but I see little reason to aim for that: a difference of 2.6e-06 in the camera orientation is a displacement smaller than a thousandth of a pixel.
Mar
7
comment From Position/Target to Orientation/Elevation
Ah. If you switch Y and Z, the first argument to the second atan2 call should become dy.
Mar
7
comment From Position/Target to Orientation/Elevation
Well, swapping dy and dz is the way to go. Maybe you’re not converting radians back to degrees?
Mar
4
comment Given face normal and vertices of a triangle, how to find the acyclic order of vertices?
Given that a cross product is only additions and multiplications, and assuming the implementation is correct, if a cross product results in NaN values it means that one of the initial vectors had a NaN component. Maybe you have uninitialised data in your triangle lists?
Feb
5
comment Improving the performance of smooth movement up and down
Well I think your time (and, indirectly, ours) would be best used learning profiling tools and techniques, so that you can pinpoint the parts that are actually slow.
Feb
5
comment Improving the performance of smooth movement up and down
How many objects do you have? I have trouble believing that using a sine wave is “slightly slow”.
Feb
4
comment Gerstner wave function simplified?
Here’s a tip: the common typographic convention for vectors is to use boldface.
Feb
2
comment Why are the coordinates interchanged in Monogame?
If changing the orientation from portrait to landscape doesn’t change anything, you are probably doing it wrong.
Feb
1
comment How does atan2 work when getting angle of a vector?
The blue part of your drawing is wrong.
Jan
28
comment How do I use the dot product to get an angle between two vectors?
Note that your intended use of the dot product only works when the initial vectors are unit vectors.
Jan
24
comment How to optimize the distance function?
This is the best answer. There is nothing to optimise in the distance function; one just needs to use it less often.