Advertisement

nehegl2... nehe dialog

Started by March 03, 2003 01:46 PM
6 comments, last by chris1 22 years ago
I read through first 15 nehe tuts... and understand quite well.. Now i tried a first noob demo.. omg doesnt look pretty well but ok... I was thinking about a dialog for choosing resolution... when I found the one @ nehe.gamedev.net Now i got the problem that whatever i write in Draw().. except of the writing stuff doesnt work.. i know i am a noob but please help me.. ps : i tried for example to put the lesson 2 code in and deleted the old code in Draw(void) but whatever I write in it I just get a stupid black window... Help please !!!
quote:
glBegin(GL_TRIANGLES); // Ein Dreieck soll gezeichnet werden glColor3f(0.0f,0.0f,1.0f); // es soll blau werden glVertex3f( 0.0f, 1.0f, 0.0f); // Die obere Ecke des Dreiecks glVertex3f(-1.0f,-1.0f, 0.0f); // unten links glVertex3f( 1.0f,-1.0f, 0.0f); // unten rechts glEnd(); // Zeichenaktion beenden
( with the glClear and the other stuff of course ) ps : I am a 16 year old stupid noob who learned c++ and who is just beginning with win stuff and ogl... so please help me or I get crazy with this.. // edit : sorry i put the german help in... [edited by - chris1 on March 3, 2003 2:47:28 PM]
1. Are u using glFlush()???
2. Could you give us more source pls?
3. What does a noob meen? (~BTW)
4. Are u using SwapBuffers after Draw()?
5. Are u calling glClear after Draw() (=You shouldn't)
6. Is ModelView the actual matrix?
7. Do u call glLoadIdentity before drawing?


PM



I hope GeForce FX is a joke .


Excuse my poor english!

[edited by - PM on March 3, 2003 2:56:27 PM]
PM Times change... Excuse my poor english!
Advertisement
The code used nehegl dialog standard in winmain :

tickCount = GetTickCount ();
Update (tickCount - window.lastTickCount);
window.lastTickCount = tickCount;
Draw ();
SwapBuffers (window.hDC);


how to put modelview on... thats my mistake i think ??
could u post some code that should work... ?? just an easy cube or something like ???

damn l3.. ( an old system done in 80's we have to learn at school at moment.. just found 3 syntax mistakes cuz of that school shit )

a noob == newbee == beginner == stupid == me

glFlush... I am using after the Draw but I forgot what it is about.
i call loadidentity
i call glClear before i draw the scene
modelview should be used matrix @ moment

didnt anyone used this source ?? and can give me the code for a easy cube so I can find my mistake ??

last in text function so modelview should be on
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glEnable(GL_DEPTH_TEST);

somethin like this ( I am not using this code ) should work I think but it doesnt :
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity(); // Reset
glColor3f(0.0f,0.3f,1.0f);
fNeHe.SetBase(32); //
fNeHe.Print(20,30,"NeHe Productions Presents:");
glColor3f(1.0f,1.0f,0.0f);
fNeHe.SetBase(32 - 128); //
fNeHe.Print(20,50,"NeHe Base Code Version 2.0");
glLoadIdentity();
glBegin(GL_TRIANGLES);
glVertex3f( 0.0f, 1.0f, 0.0f);
glVertex3f(-1.0f,-1.0f, 0.0f);
glVertex3f( 1.0f,-1.0f, 0.0f);
glEnd();
glFlush ();

i know i am doing some really stupid mistake but i cant find it...

[edited by - chris1 on March 3, 2003 3:33:46 PM]

[edited by - chris1 on March 3, 2003 3:34:53 PM]
I''m not sure what the NeHe text drawing routine is like, but I expect it switches to Ortho (kinda 2D) mode to draw... If this is right you need to reset your matrices afterwards. You can look up how to do that in his font tutorials. Another mistake could be wrong vertex coordinates. I think the 0.0f values of your vertices might be the problem (try -1.0f or 1.0f for all three z coordinates instead of 0.0f) I''m quite sure one of these 2 is the problem. If you still can''t find it you can always send your code (zipped) to me (HNSProgramming@hotmail.com) so I can look at it but I think you should be able to fix it now by yourself...

Oh, and by the way, I''m not sure how advanced tutorial 15 is but I think quite advanced. I think you''re not entirely ready for this yet. Try practising with the first 10 tutorials A LOT first so you get used to them, so you can DREAM the effects and know exactly what stands for what, what does what, etc. It''s REALLY important you don''t seem to know this yet but you really need it if you want to get that demo running...

| Panorama 3D Engine | Contact me |
| MSDN | Google | SourceForge |
Try putting:

glBegin(GL_TRIANGLES);
glVertex3f( 0.0f, 1.0f, -4.0f);
glVertex3f(-1.0f,-1.0f, -4.0f);
glVertex3f( 1.0f,-1.0f, -4.0f);
glEnd();

it looks like your drawing to close to the camera, the above should draw the triangle 4 units into the screen.

"To err is human, to really mess up requires a computer"


Hyperdev
"To err is human, to really mess up requires a computer"
ok the post from me was stupid (z = o.o) but it still doesnt work....

The problem are not the effects the problem is I dont get it all working with nehegl dialog... and yes Ortho was called but normally it should be off after text again..

[edited by - chris1 on March 3, 2003 3:54:16 PM]
Advertisement
Hey.....First Post,

Have you tried using glTranslatef() before you render(After LoadIdentity)....

Also Did you have texturing enabled when you first created the prog? Check glInit()(or whatever you call it) for
glEnable(GL_TEXTURE_2D)....Maybe just try glDisable(you get the point) before rendering.



if vbChickenIsDead=true then
vbCookChicken
if vbChickenIsDead=true then vbCookChicken
I did it all another way and made it my own.. not using nehegl2

it works fine and everything is OK

This topic is closed to new replies.

Advertisement