Skip to content

Instantly share code, notes, and snippets.

View cmuratori's full-sized avatar

Casey Muratori cmuratori

View GitHub Profile
This file has been truncated, but you can view the full file.
<!DOCTYPE html><html lang='en' itemscope itemtype='https://schema.org/Article'><head>
</head>
<body>
<svg id='Graph' style='width:100%;height:50vh;user-select:none;' viewBox='0 0 21.487562 16.000000'>
<g id='ViewXForm'>
<line x1='0.693147' y1='0' x2='0.693147' y2='16.000000' vector-effect='non-scaling-stroke' stroke='#eeeeee' stroke-width='1.0' />
<line x1='1.098612' y1='0' x2='1.098612' y2='16.000000' vector-effect='non-scaling-stroke' stroke='#eeeeee' stroke-width='1.0' />
<line x1='1.609438' y1='0' x2='1.609438' y2='16.000000' vector-effect='non-scaling-stroke' stroke='#eeeeee' stroke-width='1.0' />
<text x='2.197225' y='16.000000' fill='#888888' font-size='0.5' alignment-baseline='baseline'>8b</text>
<line x1='2.197225' y1='0' x2='2.197225' y2='16.000000' vector-effect='non-scaling-stroke' stroke='#888888' stroke-width='1.0' />
If I'm understanding correctly:
If you are talking about position, then the apparent relative position of the mesh (m) relative to the camera (c) is just (m - c). This means that, relative to the mesh, the camera _already has_ the position track you wanted the mesh to get, only it's negated.
So one answer is, assuming the mesh is at the origin, just copy the translation track from the camera to the mesh, and negate all three translation channels (X/Y/Z). Move the camera back to the origin, and zero out its animation. That should "just work".
If you are tool can't do that, depending on how you need to construct this, and what your art tool supports, you could go through some relatively convoluted nonsense, for example:
1) Create a dummy object at the location of the mesh.
2) Parent the camera to the dummy, but make sure to leave it's relative transform (don't zero it).
@cmuratori
cmuratori / gist:48ab8f6a6d78196e1323d4a0796e7732
Created July 8, 2016 05:32
Microsoft Visual Studio 2012 Internal Compiler Error
// Put this in a .c file and cl it to cause the internal compiler error. It also crashes as a .cpp, but you have to extern "C" the declarations.
typedef union __m128 {float m128_f32[4];} __m128;
__m128 _mm_load_ps(float const *);
void _mm_store_ps(float *, __m128);
void main(void) {_mm_store_ps(0, _mm_load_ps(0));}
/* ========================================================================
$File: tools/ctime/ctime.c $
$Date: 2016/05/08 04:16:55PM $
$Revision: 7 $
$Creator: Casey Muratori $
$Notice:
The author of this software MAKES NO WARRANTY as to the RELIABILITY,
SUITABILITY, or USABILITY of this software. USE IT AT YOUR OWN RISK.