---
layout: doc
title: general / lookat_rotate2
---
# lookat_rotate2

### NAME

    lookat_rotate2() - build a look-at rotation from eye and target points

### SYNOPSIS

    float array lookat_rotate2( float array matrix, float ex, float ey, float ez,
                           float lx, float ly, float lz );

### DESCRIPTION

    Replaces matrix with a look-at transform and returns matrix.  The eye
    point is given by ex, ey, and ez.  The look point is given by lx, ly,
    and lz.

    The argument must be a 16 element float array in the format returned by
    id_matrix().  This efun modifies the supplied matrix array in place.

    Unlike lookat_rotate(), this efun does not take the eye point from the
    current matrix.  It uses the supplied eye point and an initial up vector
    of (0.0, 1.0, 0.0), then derives and normalizes the basis vectors for
    the resulting view matrix.

### SEE ALSO

    lookat_rotate(3), id_matrix(3), translate(3)
