Click here to Skip to main content
16,021,294 members
Home / Discussions / Game Development
   

Game Development

 
AnswerRe: Multiplayer Poker Pin
AspDotNetDev5-Nov-11 10:48
protectorAspDotNetDev5-Nov-11 10:48 
AnswerRe: Multiplayer Poker Pin
Alisaunder6-Jan-12 2:54
Alisaunder6-Jan-12 2:54 
Question'Self-aware' classes? Pin
Purge1t30-Oct-11 18:54
Purge1t30-Oct-11 18:54 
AnswerRe: 'Self-aware' classes? Pin
CDP180231-Oct-11 9:21
CDP180231-Oct-11 9:21 
GeneralRe: 'Self-aware' classes? Pin
Purge1t31-Oct-11 14:26
Purge1t31-Oct-11 14:26 
GeneralRe: 'Self-aware' classes? Pin
CDP180231-Oct-11 15:39
CDP180231-Oct-11 15:39 
AnswerRe: 'Self-aware' classes? Pin
_Maxxx_31-Oct-11 18:33
professional_Maxxx_31-Oct-11 18:33 
Questionmodel, shade, looksRealistic OpenGL Pin
appollosputnik25-Oct-11 3:34
appollosputnik25-Oct-11 3:34 
Dear Friends
I am successfully able to generate a 3D surface by revolving the profiles by 360 degree. Now my 3d model is in red color so the color is so shining I am not able to distinguish various parts in the model. For this I am trying to use some lighting but I am not successful. Can u help me someone what kind of lighting should I use so that my model looks realistics and I would be able to visualize various parts on the model . Check my snippet I am trying to use this kind of lighting but finding black shadows on the sides not able to visualize properly. Thanks a lot for any help.

[code]
void CRevolutionProjView::OnViewShade()
{
// TODO: Add your command handler code here
// TODO: Add your command handler code here

CDC* pDC = GetDC();
wglMakeCurrent(pDC->m_hDC, m_hrc);

glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glShadeModel(GL_SMOOTH);
glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_FASTEST);
// Enable light and setup 2 light sources (GL_LIGHT0 and GL_LIGHT1)
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_LIGHT1);
glColor3f(1.0f, 0.0f, 0.0f);
// We're setting up twolight sources. One of them is located
// on the left side ofthe model (x = -1.5f) and emits white light. The
// second light sourceis located on the right side of the model (x = 1.5f)
// emitting red light.
// GL_LIGHT0: the whitelight emitting light source
// Create lightcomponents for GL_LIGHT0
GLfloat emissionLight0[] = {0.2f, 0.0f, 0.0f, 1.0f};
GLfloat ambientLight0[] = { 0.2f, 0.2f, 0.2f, 1.0f };
GLfloat diffuseLight0[] = { 0.8f, 0.8f, 0.8, 1.0f };
GLfloat specularLight0[] = { 0.5f, 0.5f, 0.5f, 1.0f };
GLfloat position0[] = { -1.5f, 1.0f, -4.0f, 1.0f };

// Assign createdcomponents to GL_LIGHT0
glLightfv(GL_LIGHT0, GL_AMBIENT, ambientLight0);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseLight0);
glLightfv(GL_LIGHT0, GL_SPECULAR, specularLight0);
glLightfv(GL_LIGHT0, GL_EMISSION, emissionLight0);
glLightfv(GL_LIGHT0, GL_POSITION, position0);
// GL_LIGHT1: the redlight emitting light source
// Create lightcomponents for GL_LIGHT1
float ambientLight1[] = { 0.2f, 0.2f, 0.2f, 1.0f };
float diffuseLight1[] = { 0.8f, 0.8f, 0.8f, 1.0f };
float specularLight1[] = { 0.5f, 0.5f, 0.5f, 1.0f };
float emissionLight1[] = { 0.2f, 0.0f, 0.0f, 1.0f };
float position1[]= { -1.5f, 1.0f, -4.0f, 1.0f };
// Assign createdcomponents to GL_LIGHT1
glLightfv(GL_LIGHT1, GL_AMBIENT, ambientLight1);
glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuseLight1);
glLightfv(GL_LIGHT1, GL_SPECULAR, specularLight1);
glLightfv(GL_LIGHT1, GL_EMISSION, emissionLight1);
glLightfv(GL_LIGHT1, GL_POSITION, position1);
//---------------------------------
// enable color tracking
glEnable(GL_COLOR_MATERIAL);
// set material properties which will be assigned by glColor
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
// ...Somewhere in the main rendering loop of your program...
// Draw a polygon with material properties set by glColor
float specReflection[] = { 0.8f, 0.8f, 0.8f, 1.0f };
glMaterialfv(GL_FRONT, GL_SPECULAR, specReflection);
glMateriali(GL_FRONT, GL_SHININESS, 96);
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
Invalidate();
wglMakeCurrent(NULL,NULL);
}
[/code]
AnswerRe: model, shade, looksRealistic OpenGL Pin
CDP180225-Oct-11 5:10
CDP180225-Oct-11 5:10 
QuestionHow to set pixelz using XNA and C# Pin
CDP180213-Oct-11 21:57
CDP180213-Oct-11 21:57 
AnswerRe: How to set pixelz using XNA and C# Pin
rj4524-Oct-11 11:54
rj4524-Oct-11 11:54 
GeneralRe: How to set pixelz using XNA and C# Pin
CDP180225-Oct-11 2:02
CDP180225-Oct-11 2:02 
Questioni need your help Pin
gif202014-Sep-11 1:39
gif202014-Sep-11 1:39 
AnswerRe: i need your help Pin
Pete O'Hanlon14-Sep-11 2:13
mvePete O'Hanlon14-Sep-11 2:13 
GeneralRe: i need your help Pin
gif202014-Sep-11 6:10
gif202014-Sep-11 6:10 
GeneralRe: i need your help Pin
Pete O'Hanlon14-Sep-11 6:47
mvePete O'Hanlon14-Sep-11 6:47 
GeneralRe: i need your help Pin
gif202014-Sep-11 8:33
gif202014-Sep-11 8:33 
AnswerRe: i need your help Pin
Mahdi Nejadsahebi25-Sep-11 1:01
Mahdi Nejadsahebi25-Sep-11 1:01 
AnswerRe: i need your help Pin
Paul Conrad25-Oct-11 6:01
professionalPaul Conrad25-Oct-11 6:01 
AnswerRe: i need your help Pin
Peter Hawke28-Dec-11 13:03
Peter Hawke28-Dec-11 13:03 
QuestionMy first released game Pin
Thomas.D Williams21-Jul-11 5:18
Thomas.D Williams21-Jul-11 5:18 
AnswerRe: My first released game Pin
Richard MacCutchan28-Jul-11 3:41
mveRichard MacCutchan28-Jul-11 3:41 
GeneralRe: My first released game Pin
Thomas.D Williams28-Jul-11 6:06
Thomas.D Williams28-Jul-11 6:06 
GeneralRe: My first released game PinPopular
Richard MacCutchan28-Jul-11 6:10
mveRichard MacCutchan28-Jul-11 6:10 
GeneralRe: My first released game [modified] Pin
Rakesh Meel6-Sep-11 1:53
professionalRakesh Meel6-Sep-11 1:53 

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.