Submit
In response to opengl lights
6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Jun 30, 2003 at 21:32

use glLightfv(GL_LIGHT0,GL_POSITION,lightposition) as if you would draw a point.. means you possibly draw it at the moment it would just sit in front of your cam, without translation and rotation yet..

place the function where you draw the landscape..

In response to opengl lights
F699ebb187331fdf7f7875320e3e7e3e
0
starboarder2001 101 Jun 30, 2003 at 21:15

this is what i am doing now:

//example1
float ambientlight[4]; //ambient light
float diffuselight[4]; //diffuse light
float specularlight[4]; //specular light
float lightposition[4]; //light position

//i would setup the 4 variables above here//

glLightfv(GL_LIGHT0,GL_AMBIENT,ambientlight);
glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuselight);
glLightfv(GL_LIGHT0,GL_SPECULAR,specularlight);
glLightfv(GL_LIGHT0,GL_POSITION,lightposition);

glLightf(GL_LIGHT0,GL_CONSTANT_ATTENUATION,0.9);
glLightf(GL_LIGHT0,GL_LINEAR_ATTENUATION,0.1);
glLightf(GL_LIGHT0,GL_QUADRATIC_ATTENUATION,0.1f);

glEnable(GL_LIGHT0);

this is what i tryed:

//example2
float ambientlight[4]; //ambient light
float diffuselight[4]; //diffuse light
float specularlight[4]; //specular light

//i would setup the 4 variables above here//

glPushMatrix();

glTranslatef(0,0,10);
glLightfv(GL_LIGHT0,GL_AMBIENT,ambientlight);
glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuselight);
glLightfv(GL_LIGHT0,GL_SPECULAR,specularlight);
glLightf(GL_LIGHT0,GL_CONSTANT_ATTENUATION,0.9);
glLightf(GL_LIGHT0,GL_LINEAR_ATTENUATION,0.1);
glLightf(GL_LIGHT0,GL_QUADRATIC_ATTENUATION,0.1f);
glEnable(GL_LIGHT0);

glPopMatrix();

Example 2 didnt work.. :sigh: can you give me a small example of how to setup a light using glTranslate(..);? are you shure that is how you can set the lights position?

In response to opengl lights
E05263ec846eb85da803f56e2917962d
0
Noor 101 Jun 30, 2003 at 20:36

i believe you need to set the position of the light using the glTranslatef() function instead of changing the light position. Try that and see if that works. Let me know about the results.

In response to opengl lights
F699ebb187331fdf7f7875320e3e7e3e
0
starboarder2001 101 Jun 30, 2003 at 20:23

the lighting is working…and i calculated the normals for all the polygons. The problem is that when i move the camera with gluLookAt() the light seems to move with the camera? if i set the light position at 0,10,0 when i move the camera to 0,0,-20 the light is now at 0,10,-20.

screenshots:

(Link Is Down):sigh:

In response to opengl lights
E05263ec846eb85da803f56e2917962d
0
Noor 101 Jun 30, 2003 at 19:54

did you do glEnable(GL_LIGHT0); ?
also, did you do: glEnable(GL_LIGHTING); ?

0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Jun 30, 2003 at 17:20

I have three points:

  • It is possible to model anything, and to animate anything, simply using OpenGL commands because even if you do use Maya, 3DSMax etc, you still need to feed the data into OpenGL commands
  • It isn’t practical to draw more than a VERY simple object manually. You need to figure out all the co-ordinates and type them in. It’s hard to do and harder to maintain. Like writing your whole app in ASM.
  • Why a liver? why not a heart, spleen, stomach, small intestine…

that’s about it :)

3a28227e8f3c9837610adb0c0a76e654
0
like_gobeawan 101 Jun 30, 2003 at 15:52

yup, i would like some sample code on rendering irregular shape 3D object, eg. liver, phone, animal, etc. which is modeled using OpenGL basic command only, not relying on the available 3D modeler such as Maya/3DMax.
would it be feasible ? afterwards, i need to animate the objects modeled.
thx for the help !

:) :D :)

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Jun 30, 2003 at 14:21

what do you mean by sample code ? code that shows you how to render primitives using opengl ? i could provide you with that. i could mail it to you… let me know…

In response to stl problems
F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Jun 25, 2003 at 15:04

windows
vs.net
my stl implementation was stlport…
i found out that the problems i have are related to stlport since the programm compiles with the ms stl. vs totally messes up the project settings when i create a new dll so i’ll just have to reinstall it. i never had such an error before. strangest thing i have seen so far.

In response to stl problems
E05263ec846eb85da803f56e2917962d
0
Noor 101 Jun 25, 2003 at 14:18

What kind of coding are you using?
what kind of OS are u using?

In response to stl problems
F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Jun 25, 2003 at 13:58

ok, now nothing works again. i compiled when i linked to the non-debug libs but it throws an expection when i start it. i’m thinking about reinstalling visual studio…

In response to stl problems
F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Jun 25, 2003 at 13:44

ok, the problem was somehow related to the crt. i told it to link to the non-debug libs even in debug build and after that everything worked fine. now i just need to find out what’s going wrong when i link to the debug libs…

E05263ec846eb85da803f56e2917962d
0
Noor 101 Jun 22, 2003 at 13:57

OPPS :eek:. Oh my God.. :huh: .. I did not even notice that… Ok sorry apex, I guess I’m ganna have to change mine…

0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Jun 22, 2003 at 13:30

apex:

Welcome back Yau..long time no see.

nkharrat:

Welcome back Yau. Long time no see.

IT’S A CONSPIRACY!!

E05263ec846eb85da803f56e2917962d
0
Noor 101 Jun 22, 2003 at 12:51

Welcome back Yau. Long time no see.

[EDIT]
Welcome back yau. We haven’t seen you in our forum lately
[/EDIT]

Thanks baldurk ;) . Good one though! :yes:

Fdbdc4176840d77fe6a8deca457595ab
0
dk 158 Jun 21, 2003 at 19:38

Welcome back Yau..long time no see.

This is just an idea: if you’re considering making a multi-platfrom GUI application, you might want to check out the Qt Library. You won’t have to deal with Win32 or any other platforms. If you’re just interested in win32, then that’s another story.

590e8bdac8129bd87b188df15e62d0e5
0
CyraX 101 Jun 21, 2003 at 16:35

Create and Instance of CButton class.
And provide it with the pos.x and pos.y. Then “show” it. This step is very important because by default the windows (Even a button/text is a window) are created in hide mode.
Same is the case with text(CLabel)

0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Jun 21, 2003 at 14:47

when I did it, you used CreateWindow. The parent window is the window you want the widget to be on, and the class was one of several pre-defined types. “Text” maybe being one of them, my memory isn’t very good. Then the x, y, width and height help you.

Also, welcome back! It’s been a long time

C24eb7e6aaefba78b94c831ddc7b4d0b
0
donBerto 101 Jun 21, 2003 at 14:33

first of all, WELCOME BACK! it’s been a LONG while since you were here.

hmm… I’ve made my own widget system for a GL rendering context. if you want, you could use glut, glfw or whatever other widget class and just make the appropriate calls. if you want to make your own… that’s an option too.

sorry if that doesn’t help.
:yes:

In response to IRC reminder
Ee929cc65f2f5f9a3b9000499399ecf8
0
SubLogic 101 Jun 17, 2003 at 06:14

@Angel_of_Death

Thx :D Shit, now I start spaming myself :o

I like your avatar.. I mean the content.. maybe if you change the font and add a few more colours you’ll make it look better :huh:

In response to Admins click here!
Ee929cc65f2f5f9a3b9000499399ecf8
0
SubLogic 101 Jun 16, 2003 at 17:26

good idea and good luck! :)

In response to IRC reminder
0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Jun 16, 2003 at 17:25

yeh, some people pop in and out. I can only be on 6pm - 10pm GMT weekdays, and most weekends.

In response to Admins click here!
0684f9d33f52fa189aad7ac9e8c87510
0
baldurk 101 Jun 16, 2003 at 17:14

yeh, we’re going to be working on changing the board. I’m (going to be) helping apex with coding in PHP/MySQL, and I’d hope that the board will slowly mutate. Removing bad features, adding good ones, changing others.

In response to IRC reminder
Ee929cc65f2f5f9a3b9000499399ecf8
0
SubLogic 101 Jun 16, 2003 at 16:59

Heh, I’m on IRC all the time, I joined the channel.. nobody there but a certain ChanServ - jeeez! Wonder who that could be :huh: rofl

In response to Admins click here!
Ee929cc65f2f5f9a3b9000499399ecf8
0
SubLogic 101 Jun 16, 2003 at 16:13

Well… Let’s just say not everybody likes them.. They even say that phpBB version1 is better than invision - I can’t agree with them because invision has a function I like, uploading source code (wich vBulletin also has by the way) but from what I heard…..

<SubLogic> what do you think about invision board forums?
<_Jedi_> SubLogic vBulletin is better imho
<Dragnslcr> SubLogic- I’ve only seen one Invision board, and I didn’t like it

That’s the log of #php on undernet, I just asked that question now, almost “live” :P

Welcome to DevMaster, a community-driven game development website of posts and resources!

Recent Tags

indie × 5
game-development × 5
ios × 3
android × 3
iphone × 1
c# × 1
mobile × 1
physics-engines × 1
native × 1
macos × 1
sound × 1
music × 1
multiplayer × 1
networking × 1
testing × 1
game-programming × 1
design-patterns × 1
3d-engine × 1
shaders × 1
cross-platform × 1
gaming × 1
game-design × 1
game-industry × 1
graphics × 1
royalty × 1