Tag Info

New answers tagged

0

this picture adds the symmetry needed to solve the question easier. Just project L along the vector CL so that |P-O|=|T-O|. Now it's obviously just two identical triangles (CPO and C'TO) rotated by your desired angle. I.E. ang(OT)-ang(OP) C' and L' are both the same as C and L after rotating, about O, by the same amount.


0

Assuming we wish to have N checkpoints: we being by randomly picking sqrt(N) vertices on the graph (possibly a tree). We now pick N random distinct vertices. We compute the Dijkstra distances of each such randomly picked vertex from the closest existing checkpoint. We then proceed to declare the winner as the one furthest away from any other existing ...


0

You need to create emtpy gameobject and add colliders to it. Also, check the istrigger? checkbox. because, a normal collider will not allow the bird to pass through


1

If I understand correctly, what you want to compute is the spline's radius of curvature at each point. Then you want to compare that value to an agent's turning radius to determine if the agent will leave the track there. [1] To do this, you need to calculateR(s)as you see here: https://en.wikipedia.org/wiki/Curvature (under "Curvature of plane curves" > ...


0

Please Note atan is not broken. arctan or tan inverse is only a function between -PI/2 and PI/2. It repeats this pattern but then it isn't a function which is a problem for a computer as it doesn't handle multiple answers. This is the same for asin between -PI/2 and PI/2 and acos between 0 and PI. These are the simplest ranges for a function to occur. ...


0

If you're really reluctant to go into full-on 3D programming, I would suggest looking into raycasting. A very good explanation of this technique (coded in Javascript) can be found on this webpage. Raycasting is pretty simple, mathematically. A raycaster's in-game camera will send out abstract "rays" that are meant to collide with solid objects in the ...


0

Maybe you are overthinking it? From what I understand, each "upgrade" will increase by 1 every "step" so you can just keep track of gold and the current value of each upgrade: totalGold = 0 triangleUpgrades = [] def step(): for i in range(len(triangleUpgrades)): triangleUpgrades[i] += 1 totalGold += triangleUpgrades[i] def ...


2

Here's a function that interpolates between Start and End quadratically by T. float Qerp (float Start, float End, T) { //The quadratic stuff T = 1 - T; T = 1 - (T * T); float Difference = End - Start; return (Start + (Difference * T)); } I.e.: float Elapsed = 0; const float Length = 2.5f; while (true) { Time.timeScale = Qerp ...


1

I'm sorry for answering my own question: I figured it out and it was just a matter of correct visualization. The inside-triangle check only works if the sphere meets the triangle head-on: in other words, the point of tangency between the sphere and the plane occurs exactly at the correct time. In the other case, if the sphere passes by the triangle such that ...


1

@Richard Byron explained well and gave a well-made sample code. I think it's better to add additional information about the basic math. I leaved out the wall collision. Sorry for bad hand writing an drawing.


2

Like Pieter mentioned, you can use 1D kinetic equation for height, which in your case will come to: h = p + vt + 0.5at^2 where a is the acceleration due to gravity. You can then use the quadratic equation to solve for t. Once you have t, you can use the kinetic equations again to calculate how far the ball has travelled width ways. This would tell you ...


4

Normalization The best option would probably be to normalize the data. This can easily be done using the formula: x = a + (X - A) * (b - a) / (B - A) where a and b are the minimum and maximum values for your desired range, respectively; A and B are the minimum and maximum values for your original range, respectively; X is the input value (in your case, ...


0

Well, that is the mathematical reason why it's problematic, but I'd prefer an analytical explanation. A LookAt(pos, look, up) transform (you call it "cameraposition") is meant to represent a camera located at pos, pointing at look. However, with just pos and look, there are an infinite amount of possibilities for your camera, as you rotate it through the ...


0

float targetFieldOfView; Camera currentCamera; void Start() { currentCamera = GetComponent<Camera>(); targetFieldOfView = currentCamera.fieldOfView; } void Update() { AdjustZoom(); } void AdjustZoom() { if(Input.touchCount == 2) { Touch touchZero = Input.GetTouch(0); Touch touchOne = Input.GetTouch(1); ...


1

Now I would first suggest you use GLM, but you're using C (according to your tag) so probably not. The best math I suggest in that case is continual use of the sine and cosine functions. My examples will require math.h You will want to first store your camera's position (if you haven't already) float horizontal = cos(pitch) * GetCameraForwardSpeed(); ...


0

This link explains it way better than most could in a short answer here: http://www.tomdalling.com/blog/modern-opengl/explaining-homogenous-coordinates-and-projective-geometry/ In summary: 4x4 matrices are used in graphics so that homogeneous coordinates (which are 4d) can be used. This is important because it allows for both perspective and translation. ...


0

Old question, but here's my version (GLSL): /// <summary> /// returns the screen-space (normalized device coordinates) bounds of a projected sphere /// </summary> /// <param name="center">view-space center of the sphere</param> /// <param name="radius">world or view space radius of the sphere</param> /// <param ...


2

You are constructing a function from several inputs to meet a desired output. This function should factor the amount of each attribute in conjunction with the importance. Your use of value pairs for such a function also coheres excellently with a documented decision model. I believe that a weighted sum is in order. The weighted sum model takes in each ...



Top 50 recent answers are included