   drawing bounding box around mesh
  Hy.I would draw a yellow or red rectangle around the bounding box(rectangular bounding box) of a mesh if it is selected.I have an array of 8 point : 3dPoint{  float x;  float y;  float z;}3dPoint[7]now i must find the correct index buffer , but i'm don't know how works the indexes in opengl for lines primitives.But How i draw the correct rectangle? the first four points are the top 4 point of the rectangle and the subsequent points are the down 4 3dpoint.At the end i draw a poly, is possible to select anoter primitive?Thanks
  Seriously, you need to learn to solve problems for your own. You will never learn programming (programming = problem solving) if you come here with even the smallest issues you have, and ask for solutions.Sit down, take a paper and a pen and start thinking about the problem.   ;  Im not to familiar with this topic myself but it does interest me somewhat since I would require at some point the same answers.I have tried it but you (we) might be able to provide indices for each line on the bounding box as a set of 2.for example:unsigned int indices[] = {1, 2, // front top line2, 3, // front right line3, 4, // front bottom line4, 1, // front left line5, 6, // back top line6, 7, // back right line7, 8, // back bottom  line8, 5, // back left line1, 5, // front-back join top left2, 6, // front back join top right3, 7, // front-back join bottom right4, 8, // front-back join bottom left};Now problem would be to only draw the corners of the bounding box and not the entire box itself, which would require 8*4 vertices amd numerous indices...Anyone know of a simpler way to do this?EDIT: sorry szecs :S   ;  maybe you should read this:http://www.c-sharpcorner.com/UploadFile/jeradus/OpenGLBasics11172005014307AM/OpenGLBasics.aspxthird hit on google by the way: http://www.google.nl/search?hl=nl&source=hp&q=opengl+draw+a+box+with+lines&aq=f&aqi=&aql=&oq=&gs_rfai=   ;Quote:Original post by CodeCriminalIm not to familiar with this topic myself but it does interest me somewhat since I would require at some point the same answers.I have tried it but you (we) might be able to provide indices for each line on the bounding box as a set of 2.for example:*** Source Snippet Removed ***Now problem would be to only draw the corners of the bounding box and not the entire box itself, which would require 8*4 vertices amd numerous indices...Anyone know of a simpler way to do this?EDIT: sorry szecs :SIf you want to do it real smart, you could use a 1D texture, enabled alpha test and other "smart stuff".IMHO, you just have all the vertices for a generic box (As you said: "that's a lot of vertices, rzzzzz"), that you instance/scale/rotate/translate.   ;  Actually one of the easiest ways of doing this is by creating a line list. Either done with a index list or with an additional vertex buffer without an index buffer.How to fill this buffer is left to the OP as it is really easy to find this out.Hint have a look at D3DPT_LINELIST in DX or GL_LINES in GL