From: Julien I. <jul...@gm...> - 2011-12-16 14:23:26
|
Hi, I built and install the libvisual and libvisual-plugins from svn sources. Now, what is the fastest way to try libvisual_gl_lv_flower ? (any tool / command line ?) Sincerely Julien 2011/12/16 Antti Silvast <ant...@ik...> > Hi Julien, > > Thank you for pointing this out. This is indeed an omission: there > should be a glPushMatrix as well. > > void render_flower_effect(FlowerInternal *flower) { > > glClearColor(col1[0],col1[1],col1[2],0.0); > glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); > glMatrixMode (GL_PROJECTION); > glLoadIdentity (); > gluPerspective(60.0, (float)flower->width/(float)flower->height, > 0.01, 1135.0); > > glMatrixMode (GL_MODELVIEW); > glLoadIdentity (); > > glPushMatrix(); // ADD THIS HERE! -AS > > glTranslatef(0.0,0.0,-1.0); > > lights(flower); > glPopMatrix(); > flower->posz=FR*flower->posz_new+(1.0-FR)*flower->posz; > glTranslatef(0.0,0.0,-flower->posz); > > glRotatef(flower->rotx,1.0,0.0,0.0); > glRotatef(flower->roty,0.0,1.0,0.0); > > glRotatef(visual_timer_elapsed_msecs(&flower->timer)*0.02,0.0,0.0,1.0); > render_flower(flower); > } > > I guess the push-pop is needed to translate the lights, which are always > posited in z=-1.0, which are not like the flower, which may be in > various z-positions. > > Let me know if this helps. > > All the best, > > Antti > > On Fri, 2011-12-16 at 12:23 +0100, Julien Isorce wrote: > > Hi, > > > > In the source code of gl_lv_flower there is a glPopMatrix but there is > > no glPushMatrix before. The result is a GL_STACK_UNDERFLOW. > > Any reason for that ? > > > > > > The code of libvisual_gl_lv_flower is > > there : > http://libvisual-plugins.sourcearchive.com/documentation/0.4.0.dfsg.1/main_8c-source.html > > > > > > All libvisual plugins are > > there: > http://libvisual-plugins.sourcearchive.com/documentation/0.4.0.dfsg.1/files.html > > > > > > Sincerely > > Julien > > > |