Click here to Skip to main content
15,880,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
enhzflep 10-Oct-12 1:13am    
Sure thing mate - go and look at these tutorials: http://nehe.gamedev.net/tutorial/lessons_06__10/17010/
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,
http://www.nvidia.com/object/cube_map_ogl_tutorial.html
http://jerome.jouvie.free.fr/opengl-tutorials/Tutorial11.php

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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900