Jump to content
  • Advertisement
Sign in to follow this  
sefiroths

OpenGL letters indipendent from rotation

This topic is 4052 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i have developed a procedure that displays letters in positions, indipendent from rotation: subroutine myglprint3f(locx,locy,locz,frase,r,g,b,locscale) implicit double precision (a-h),(o-z) include<opengl.ins> include<disp.car> include<displ.car> real*8 locx,locy,locz,locscale,x1x(1),y1y(1),z1z(1)!,x,y,z character*(*) frase integer length real*8 mv(16),mp(16) integer view(4),risultato call glcolor3d(r,g,b) x=locx; y=locy; z=locz<----------are coordinates of the point where i want to write length=len_trim(frase) call glgetdoublev(GL_MODELVIEW_MATRIX,mv) call glgetdoublev(GL_PROJECTION_MATRIX,mp) call glgetIntegerv(GL_VIEWPORT,view)<-------------take the actual matrix call glpushmatrix call glloadidentity risultato= gluProject(x,y,z,mv,mp,view,x1x(1),y1y(1),z1z(1))<----------coord of the point in the screen space if(risultato.eq.gl_false) print*,'errore gluproj' ix=x1x(1); iy=y1y(1) call glReadPixels(ix,iy,1,1,GL_DEPTH_COMPONENT,GL_DOUBLE,z)<----find the z call glgetdoublev(GL_MODELVIEW_MATRIX,mv) call glgetdoublev(GL_PROJECTION_MATRIX,mp) call glgetIntegerv(GL_VIEWPORT,view)<----------matrix used to display the object risultato= gluUnProject(dble(ix),dble(iy),z,mv,mp,view,x,y,z) <------------from the coordinates pixel and the z found before, revenue how much must be x, y, z of my number if(risultato.eq.gl_false) print*,'errore gluUNproj' call gltranslatef(sngl(x),sngl(y),sngl(z)) call glscalef(sngl(locscale),sngl(locscale),sngl(locscale)) do i=1, length call numero(frase(i:i)) <---------draw a letter call gltranslated(dble(1.6),0.d0,0.d0) <----space between chars enddo call glpopmatrix end the problem is that if the z find with glReadPixel is >3.1 letter disappear... don't understand why. here a movie of what happen: http://sephiroth.web-gratis.net/print.htm

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!