I was wondering if someone could help me understand the differents between OpenGL equivelants to device.Transform.World = Matrix.Translation(dx, dy, dz) and

device.Transform.World *= Matrix.Translation(dx, dy, dz)

Thanks in advance

MikeC531

I was wondering if someone could help me understand the differents between OpenGL equivelants to device.Transform.World = Matrix.Translation(dx, dy, dz) and

device.Transform.World *= Matrix.Translation(dx, dy, dz)

Thanks in advance

MikeC531

Just basicly need to know where to put the:

glPushMatrix(); and glPopMatrix(); and

glLoadIdentity(); for the

= Matrix.Translation(dx, dy, dz) and the

*= Matrix.Translation(dx, dy, dz)

Thanks again

MikeC531

OpenGL doesn’t feature utility functions like this.

You have to construct your own transform matrices (no big deal, right?).

The (fixed function) OpenGL matrix commands operate directly on the matrix on top of the current “matrix stack”:

You can use glLoadMatrix() to assign a defined matrix directly to the top ModelView, Projection or Texture matrix.

If you want to set the top matrix to a particular translation matrix, you can set it to identity, and then multiply it by a translation matrix, like so:

```
glLoadIdentity()
glTranslate()
```

If you want to multiply in an additional translation to the current matrix, all you need is this:

```
glTranslate()
```

If you want to save and restore the current matrix so you can undo the matrix changes after some drawing, you can use Push/Pop matrix and the above two cases become:

```
glPushMatrix()
glLoadIdentity()
glTranslate()
// draw some stuff
glPopMatrix // back to the matrix state before the push
```

and

```
glPushMatrix()
glTranslate()
// draw some stuff.
glPopMatrix()
```

But these OpenGL commands do not operate on “your” matrices. They operate on the OpenGL matrix stacks.

There are no OpenGL helper functions to provide generic manipulation of any matrices. Although you could read the resulting matrix off the top of the matrix stack with glGetFloatv, I suppose.

These matrix manipulation commands are more associated with the classic OpenGL fixed function pipeline, and I imagine they are rarely used with shaders (I believe they have been deprecated in recent GL specifications).