Click here to Skip to main content
Rate this: bad
good
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 18:32pm
BalsP305
Comments
enhzflep at 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 at 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 at 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 at 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 at 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
0 Sergey Alexandrovich Kryukov 505
1 OriginalGriff 258
2 ChintanShukla 195
3 Bhavik_Patel 170
4 Richard Deeming 165
0 Sergey Alexandrovich Kryukov 8,688
1 OriginalGriff 7,237
2 CPallini 2,598
3 Richard MacCutchan 2,080
4 Abhinav S 1,888


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 15 Apr 2013
Copyright © CodeProject, 1999-2014
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