I am afraid I don't understand your question - can you give a little more detail about what you are trying to do? You want to add a texture onto your axes, or something else? Or do you mean you are trying to use a texture to apply the words 'x-axis', 'y-axis', and 'z-axis' to your rendering??

I am afraid I don't understand your question - can you give a little more detail about what you are trying to do? You want to add a texture onto your axes, or something else? Or do you mean you are trying to use a texture to apply the words 'x-axis', 'y-axis', and 'z-axis' to your rendering??

I want to visualize the current XYZ orientation by rendering the coordinate axes as three arrows. The arrows should rotate as I rotate the model. I want to render the arrows in a fixed size in the bottom left corner like cylinder geometries, not just lines. I think using a 3d texture with cylinder arrows will be nice solution, but, I may be wrong.

Ahh ok - now I understand. In that case, you want to create a 3d model just like you would any other model, but with the axes pointing in their respective directions in object space. Then, whatever transformation you apply to your model when you render it, you would just do the same for the axes model.

Using a 3D texture is possible, but it would be horribly inefficient because 3D textures use tons of memory. In this case, it is better to just go with a regular polygonal mesh.

Ahh ok - now I understand. In that case, you want to create a 3d model just like you would any other model, but with the axes pointing in their respective directions in object space. Then, whatever transformation you apply to your model when you render it, you would just do the same for the axes model.

Using a 3D texture is possible, but it would be horribly inefficient because 3D textures use tons of memory. In this case, it is better to just go with a regular polygonal mesh.

If you say so... But it must have a static position (left bottom corner) and do not change it while i change lookAtVector etc. Also, it must rotate around it's own origin point, not around of the model. To achive this, I use sprites for drawing static elements (I have few of those) and vertices (VertexBuffer) to draw model.

Maybe you have some code samples of this, couse I don't know how to build cylinders like a polygonal mesh? Will be very appreciate

Ahh ok - now I understand. In that case, you want to create a 3d model just like you would any other model, but with the axes pointing in their respective directions in object space. Then, whatever transformation you apply to your model when you render it, you would just do the same for the axes model.

Using a 3D texture is possible, but it would be horribly inefficient because 3D textures use tons of memory. In this case, it is better to just go with a regular polygonal mesh.

If you say so... But it must have a static position (left bottom corner) and do not change it while i change lookAtVector etc. Also, it must rotate around it's own origin point, not around of the model. To achive this, I use sprites for drawing static elements (I have few of those) and vertices (VertexBuffer) to draw model.

Maybe you have some code samples of this, couse I don't know how to build cylinders like a polygonal mesh? Will be very appreciate

Ok - I didn't realize that you wanted it to stay in one location on the screen. In that case, you should apply the rotation from your model to the axes, and use a fixed translation component for putting it into the location you want it. Keep in mind that the position should be relative to the view position if you want it to follow the camera around as it moves. Or you could set the view matrix to be the identity when you go to render the axes, allowing you to choose a fixed translation and leave it there.

For examples about building cylinders and cones, you can find lots of resources around the net. I have some of these operations implemented in my engine, Hieroglyph3, which you can download and use under the MIT license.

The point is that I'm already using sprites and it will be better for me to keep working with them. I can apply world changes to sprite and set origin point of it, so problem with position and rotation are solved. But, I don't know is it possible to draw something else exept 2D texture rectangle or text with help of sprite. If there are some other primitives, which can be drawn with sprites?

In addition to what Jason mentioned in his posts, you should not try to achieve any kind of 3D modelling using sprites, unless you want to make things really hard and inefficient for yourself. Some challenges are worth not taking.

FYI, it's generally the other way round i.e. sprites are created out of 3D models.

I'm not really familiar with the sprite functionality that you are using, but if you can apply 3d transforms to the sprite's rectangle vertices then you could do a rough approximation using a billboard style rendering. This would work ok for times when you aren't viewing the axis head on, but it would disappear when you are viewing it head on...

However, if you already have 3D models in your scene, then this should be quite similar. You can either programmatically draw the geometry with cylinders and cones, or you can use your modelling package to create the geometry and just import it like any other mesh. This is really the better way to approach the problem - I don't think you will be happy with the results when using sprites for this functionality!

I understand what you are telling me and I even have an idea how to make it with primitives, BUT, here is another problem: how to mark axes with text (x axis, yaxis... like in picture above). Those lines will be moving all the time, how to make axis marks (text) to move with their axis arrows?

Didn't thought that usual axial arrows will deal so much problems to me But I have concrete task and I must solve it.

I understand what you are telling me and I even have an idea how to make it with primitives, BUT, here is another problem: how to mark axes with text (x axis, yaxis... like in picture above). Those lines will be moving all the time, how to make axis marks (text) to move with their axis arrows?

This is normally done by defining a point in object space of your axes model that you want the text to be located at. Then you can use your transformation and projection matrices to find that location in screen space. Once you have the location in screen space, then you can use your normal text rendering system to put the text in the appropriate place. If you haven't done any manual projection of vertices before, you can check out a 'picking' tutorial for the details, as it uses much the same technique.

How to make those arrows always in front? When model is moving on it, the arrows are hiden behind the model. Playing with Z-coordinate gives nothing, only changing world position.. Maybe you have some ideas?

You could render the model first, followed by the axes. When you render the axes, simply disable depth writes and depth test for that draw call. This will ensure that the axes are drawn over the model regardless of the shape of the model.