Click here to Skip to main content
15,890,845 members
Home / Discussions / Graphics
   

Graphics

 
GeneralRe: DirectX: Resoution glitch after switching from fullscreen to windowed mode Pin
Aschratt23-Feb-10 4:43
Aschratt23-Feb-10 4:43 
AnswerRe: DirectX: Resoution glitch after switching from fullscreen to windowed mode Pin
Aschratt23-Feb-10 6:03
Aschratt23-Feb-10 6:03 
QuestionAnyone using Geometric Algebra? Pin
Tim Craig9-Feb-10 12:48
Tim Craig9-Feb-10 12:48 
QuestionSEO vs. GRAPHIC DESIGNS? Pin
hifiger20049-Feb-10 1:14
hifiger20049-Feb-10 1:14 
AnswerRe: SEO vs. GRAPHIC DESIGNS? Pin
LunaticFringe9-Feb-10 7:58
LunaticFringe9-Feb-10 7:58 
AnswerRe: SEO vs. GRAPHIC DESIGNS? Pin
Xmen Real 6-Mar-10 22:35
professional Xmen Real 6-Mar-10 22:35 
AnswerRe: SEO vs. GRAPHIC DESIGNS? Pin
fhdendy22-Mar-10 7:30
fhdendy22-Mar-10 7:30 
Question[OPENGL] render mesh/lighting Pin
yakovm38-Feb-10 19:41
yakovm38-Feb-10 19:41 
Hello,
I need to render the mesh.It is given by set of its surfaces
each surface is presented by its vertexes(x,y,z)
The camera and light source has to be placed at the same place.
I use this code:
//Projection
                        glMatrixMode(GL_PROJECTION);
			glLoadIdentity();
            

			GLdouble diam = m_allModels.getDiam();
			GLdouble left = m_allModels.getCenter()[0] - diam;
			GLdouble right = m_allModels.getCenter()[0] + diam;
			GLdouble bottom = m_allModels.getCenter()[1] - diam;
			GLdouble top = m_allModels.getCenter()[1] + diam;

            
			glFrustum(left,right,bottom,top,diam,diam*3.5);            
           
//Model
                         glMatrixMode(GL_MODELVIEW);
                         glLoadIdentity();
			 gluLookAt (0.0, 0.0,2*m_allModels.getDiam(),
			m_allModels.getCenter()[0],m_allModels.getCenter()[1],m_allModels.getCenter()[2],
			0.0, 1.0, 0.0);

//Lighting
			GLfloat light_position[] = {0.0, 0.0,0.0, 1.0 };
			GLfloat white_light[] = { 0.7, 0.3, 0.2, 1.0 };
			glEnable(GL_DEPTH_TEST);
			
			
			glEnable(GL_LIGHTING);
			glLightfv(GL_LIGHT1, GL_POSITION, light_position);
			glLightfv(GL_LIGHT1, GL_DIFFUSE, white_light);
			glEnable(GL_LIGHT1);
                        glShadeModel(GL_FLAT);
			
//Draw
			glEnable(GL_NORMALIZE);
                        glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
//render here
for(unsigned int modelIdx = 0;modelIdx < m_allModels.zise();++modelIdx)
			{
				model curModel = m_allModels.getModel(modelIdx);
				for(unsigned int modelSurfIdx = 0;modelSurfIdx <curModel.surfNum();
					++modelSurfIdx)
				{
					surface curSurf = curModel.getSurface(modelSurfIdx);
					glLineWidth(2);
					glBegin( GL_POLYGON );

					
					glNormal3f(curSurf.getN_x(),curSurf.getN_y(),curSurf.getN_z());
					for(unsigned int vertIdx = 0;vertIdx< curSurf.size();++vertIdx)
					{
						unsigned int curVertIdx = curSurf.getSurfVertices()[vertIdx];
						vertex curVert = curModel.getVertex(curVertIdx);
						glVertex3f((GLfloat)curVert.getX(),(GLfloat)curVert.getY(),(GLfloat)curVert.getZ());
					}	
					glEnd();

				}
			}

And I get this
http://img17.imageshack.us/img17/1103/64347046.png[^]
And I don't understand why
AnswerRe: [OPENGL] render mesh/lighting Pin
LunaticFringe9-Feb-10 3:48
LunaticFringe9-Feb-10 3:48 
AnswerRe: [OPENGL] render mesh/lighting Pin
ely_bob2-Mar-10 18:17
professionalely_bob2-Mar-10 18:17 
Questionsharing gl textures qith multple child windows Pin
Jim Crafton1-Feb-10 9:01
Jim Crafton1-Feb-10 9:01 
AnswerRe: sharing gl textures qith multple child windows Pin
LunaticFringe9-Feb-10 4:03
LunaticFringe9-Feb-10 4:03 
GeneralRe: sharing gl textures qith multple child windows Pin
Jim Crafton9-Feb-10 4:04
Jim Crafton9-Feb-10 4:04 
Questionplot a derivative function Pin
fulminatorz30-Jan-10 2:05
fulminatorz30-Jan-10 2:05 
AnswerRe: plot a derivative function Pin
Richard MacCutchan1-Feb-10 9:17
mveRichard MacCutchan1-Feb-10 9:17 
GeneralRe: plot a derivative function Pin
fulminatorz3-Feb-10 5:25
fulminatorz3-Feb-10 5:25 
GeneralRe: plot a derivative function Pin
Richard MacCutchan3-Feb-10 5:49
mveRichard MacCutchan3-Feb-10 5:49 
GeneralRe: plot a derivative function Pin
Luc Pattyn3-Feb-10 6:33
sitebuilderLuc Pattyn3-Feb-10 6:33 
GeneralRe: plot a derivative function Pin
fulminatorz8-Feb-10 3:37
fulminatorz8-Feb-10 3:37 
GeneralRe: plot a derivative function Pin
Richard MacCutchan8-Feb-10 3:58
mveRichard MacCutchan8-Feb-10 3:58 
Questionpicking primitives in OpenGL Pin
Jim Crafton29-Jan-10 7:17
Jim Crafton29-Jan-10 7:17 
AnswerRe: picking primitives in OpenGL [modified] Pin
LunaticFringe30-Jan-10 2:59
LunaticFringe30-Jan-10 2:59 
GeneralRe: picking primitives in OpenGL Pin
Jim Crafton1-Feb-10 8:41
Jim Crafton1-Feb-10 8:41 
QuestionManaged and UnManaged DirectX APIs. Pin
ashwath197915-Jan-10 17:45
ashwath197915-Jan-10 17:45 
AnswerRe: Managed and UnManaged DirectX APIs Pin
Baltoro24-Jan-10 10:25
Baltoro24-Jan-10 10:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.