Jump to content
• Advertisement

# Catmull Dog

Member

26

1. ## Finding the Slope of a giving Vertex in HLSL

The slope is the difference between two adjacent vertices. You probably want the point normal though, or the weighted, normalized average of all adjacent edges at a given vertex.
2. ## Algorithm for "grabbing" a Bezier spline/cubic Bezier curve

Ideally you will draw the control points and let the user drag them independently. To move the whole curve the user would type Ctrl-A to select All and then could drag any point to move the whole curve. You may prefer Catmull Rom splines as they feature control points that lie on the curve (just the span 1 to 2), where Bezier defines a control polygon and only the endpoints 0 and 3 are on the curve). You can convert between them with a formula that is not too bad (see Figure 4).
3. ## finding the closest distance of point to a line

Here is a good explanation of the 3D point to line problem. The line connecting the point to the closest point meets the line at a right angle. http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
4. ## Stuck in late development

If any bugs can delay the shipping of a product, they will. - Murphy's Law of Programming
5. ## Geologically Accurate Video Games

Sounds like the OP would enjoy the Seismic Exploration field in the Upstream Oil industry. Lots of 3d graphics these days.
6. ## Help me compile a list of simple games to program

An interactive fiction (word) game is a good short-term project. Design a map and number each room and list the connections for R rooms. Then support 10 directions (the 8 compass directions, up and down). A 10 x R matrix then stores the connections between rooms. You could show a photo in each room (perhaps a panoramic one and let the user rotate 360 degrees). Then, support simple noun/verb parsing and inventory (pick up the rock).
7. ## Gimbal Lock. Trying to describe mathematically.

Basically when you rotate, you rotate the very axes of rotation themselves, so it quickly becomes non-intuitive. Trackball style essentially counters this by applying the transpose of the camera matrix.

20. ## How to ensure affine transformation matrix represents orthogonal vectors

You basically just cross (product) two to create a third, then recross the third with the first (or second) one, and normalize them all. If you start with only one vector you can cross it with an arbitrary up vector (0,1,0) to produce the third, then recross 1 and 3 to overwrite the up vector. Just make sure the original is not the same as the up vector.
21. ## Recursive Catmull Rom algorithm

Performance was not the main reason, though I'm curious how much faster it will be. In order to achieve Centripetal Parameterization (from a 2010 paper "Parameterization and Applications of Catmull-Rom Curves"), we need a recursive approach to the Catmull Rom algorithm. That allows for arbitrary t (or s) values, which allows shape parameters. We need a Catmull Rom spline where the control points represent the points of highest curvature (please see attached image). I think many make the assumption that is the default when it's not.
22. ## Recursive Catmull Rom algorithm

In Siggraph '88 (24 years ago this week) there was a great article by Phillip J. Barry and Ronald N. Goldman titled "A Recursive Evaluation Algorithm for a Class of Catmull-Rom Splines". In the article they detail a recursive approach to evaluate a CR spline. Representing it this way allows for curve parameters to be added (thus making it Non-Uniform), altering the trajectory of the curve (similar to the Tension parameter in a Cardinal or Kochanek Bartels spline). I'm in the process of translating the formula but it's usually harder than it looks. Has anyone implemented this? How much faster is it? Is the algorithm available in C++ form? Thanks in advance. CRD
23. ## Getting an object to roll/slide

As jefferytitan notes, you want to have a tolerance that is the cutoff point where you set it to zero. Some energy is lost on impact to friction, etc.
24. ## Normal n of surface to calculate impulse

Ideally, you will use Vertex normals (take a weighted average of the normals of all adjacent triangles sharing the vertex at that point). This is easier to calculate if the surface is on a regular grid. For polygon soup you may not know all of the triangles that share that vertex. If it is as a parametric surface, the normal at u,v is (basically) the cross product of the vectors: (u,v)->(u+delta,v) and (u,v)->(u,v+delta) where delta is the tolerance, normally based on the surface sample resolution. But for starters, just use the polygon normal (normalized cross product of two edges of the nearest triangle).
25. ## Modifying Catmull Rom to Add Centripetal Parameterization

Greetings. While Catmull Rom splines have the nice property of going through the control points and are "continuous enough" for most applications, they sometimes behave unpredictably. Namely, the points of highest curvature on the resulting curve are not always where the control points lie. A solution for this is to use what is called Centripetal Parameterization which focuses more sampled points on the highest areas of curvature (the term derives from the way a car would slow down when navigating sharp turns, unless driven by this guy). The general idea is: t i+1 = t i + |P i +1 - P i] ^ a // Where (0<= a <=1) (0 is Uniform,.5 is Centripetal and 1 is Chordal). Note: This is a different type of parameterization than Chord length reparameterization (see attached slide showing adjusting the number of points between spans without altering the curve itself). Centripetal alters the trajectory of the curve, similar to the way a Kochanek Bartels spline applies Tension, but unique. There are many articles on this subject. Two of the best I found are Parameterization and Applications of Catmull-Rom Curvesand the original E T Y Lee article Choosing nodes in parametric curve interpolation, but they don't seem to explain in layman terms how to go about modifying an existing CR algorithm to make the required changes (ideally there would be an adjustable alpha to blend from Uniform (a=0) to Centripetal (a=.5) to Chordal (a=1.0), but I'm not sure if that refers to blending the results of two functions or if the alpha value really plugs in (it is raised to the power of a so it's square root for Centripetal). Question: Does anyone have the actual CR algorithm that implements Centripetal Parameterization? How different from the original CR algorithm is it and how much does it cost? With KB splines it's only a few lines difference, but not something you could improvise without a math Ph. D. Thanks in advance! CRD
• 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!