Binding texture to one vertex

As in topic - is there any possibility to do that? Maybe use GL_TEXTURE_1D ??

And how to make texture to be seen front always (when we move).

thx :slight_smile:

You need to explain in more detail what you want to achieve. The question is very confusing.

I want to display texture, and stick it to only one vertex.

e.g. i have texture of cloude, and i want to bind it to vertex (2.0f, 10.0f, 0.0f).


Hmm. I think you might have a misconception of how you render a texture on the screen.

I think you’re envisioning taking a picture (a texture) with a predefined size and poking it onto a bulletin board (the screen) with a single point, whereas the normal GPU model is you send outline of the picture (a quad) to the bulletin board and tell the bulletin board to fill it with the picture. The nice thing about that is you can not only reposition the picture, but resize it as well when you render it.

So for your cloud, let’s say you wanted it 2 units X 2 units centered on (2.0f, 10.0f, 0.0f), you’d send down quad vertex positions of: (1,9),(1,11),(3,11),(3,9), texture coordinates (0,0),(1,0),(1,1),(1,0), and slap your cloud texture on it.
This is the normal GL_QUADS route to rendering.

Note that there are other ways to do this (point sprites, drawpixels, etc.) – I’m just describing the most common way. This is the kind of thing discussed well in the OpenGL Red Book.

@Dark Photon

Thanks for your help :slight_smile: I know opengl for sometime and I know how to texture - but I’ve heard that you can stick your texture to one vertex. Is it possible ?

Well, I’m not sure I understand you, but if you mean render a quad texture by sending only a single position down the pipe, check out ARB_point_sprite. Don’t be surprised when your texture pops off when you move it half-way off screen though. It’s a point.

Another approach is glDrawPixels. Call glRasterPos to set the draw position.

@Dark Photon

You’re my man :smiley: I’ve used sprites and they are working just the way i wanted :slight_smile:

Topic is ready to be closed.