Click here to Skip to main content
12,749,754 members (35,492 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# OpenGL
Hi all,

Thanks in advance. i need some help regarding below issue.

I am writting a C# code with opengl. i am not able to apply texture for selected entity from screen (3D Model). The entity may be a plane, polygon, surface or it may be any uneven surface. once i will select the entity from 3D model then i should able to apply texture for the whole surface/body. Here i can able to select the entity and can able to apply color or material. but texture could not able to apply.
i can able to apply textures only for selected plane through loading texture and applying it for 4 vertices of selected plane using glBegin(GL_QUARDS) and glEnd(). but i want to apply texture for selected face/surface id (or) generated openGL list (or) generated unique tag, without mapping texture using glBegin and glEnd(). Can anyone help me please.

thanking you.
Posted 9-Oct-12 19:32pm
enhzflep 10-Oct-12 1:13am
Sure thing mate - go and look at these tutorials:
Santhosh_G 10-Oct-12 1:46am
For mapping textures for an un-even structure or polygons, Split the shape into triangles. And provide texture coordinate for each vertex of the triangle.
BalsP 10-Oct-12 2:00am
thanks Santhosh. i wil try to split into triangles and Is it possible any other way to apply textures for hole, chamber, fillet, non-rectangular polygon or face id.
Santhosh_G 10-Oct-12 2:55am
If the object is similar to quad, then you can map texture coordinates easily.
Please check these links,

Member 9156454 15-Apr-13 7:59am
Hi Santhosh.i have tried to apply texture for tesselation of cad models.stil i am not getting ttexture mapping on all trianle faces. i am rendering all geometry faces and then i am trying apply. is it possible to render all faces and apply then texture. thanks in advance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170215.1 | Last Updated 15 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100