Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Daunting Problem With Perl Opengl Lighting

by iSina (Acolyte)
on Jul 20, 2008 at 01:20 UTC ( #698868=note: print w/ replies, xml ) Need Help??


in reply to Re: Daunting Problem With Perl Opengl Lighting
in thread Daunting Problem With Perl Opengl Lighting

Well that is good if you are not seeing any light on that circle (which is supposed to be a sphere). You are only supposed to see some a sphere with some shading and light. If you are not then the problem should be with the code and I hope I can fix it. Can you try changing the place of the light by changing the array and see if it creates any difference? I assume it wont though... our @Light_Position = ( 1.0, 1.0, 1.0, 1.0 );


Comment on Re^2: Daunting Problem With Perl Opengl Lighting
Re^3: Daunting Problem With Perl Opengl Lighting
by grep (Monsignor) on Jul 20, 2008 at 01:40 UTC
    After changing @Light_Position I saw no change in the image.
    grep
    One dead unjugged rabbit fish later...
      Okay I found the answer in a book for perl. Obviously packing the arrays or giving reference isnt good enough
      glMaterialfv_p(GL_FRONT, GL_SPECULAR, 1, 1, 1, 1); glMaterialfv_p(GL_FRONT, GL_SHININESS, 50); glLightfv_p (GL_LIGHT0, GL_POSITION, 1, 1, 1, 0);
      did the trick
        Hi, I'm using the latest SVN rev from New Perl OpenGL Release. I found that I also had to remove the line glEnable(GL_LIGHTING); from init, or the screen was black. By the way, if you havn't seen it, there is a very nice example in the SVN rev called isosurf.pl, that is where I found those function's need for arrays. Isosurf.pl looks like it displays DNA type shapes, maybe you will find it contains some useful ideas.

        P.S. I'm running the NVidia driver on linux.


        I'm not really a human, but I play one on earth Remember How Lucky You Are

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://698868]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-07-25 04:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls