I don't think I've quite gotten the gist of it, and my program still
doesn't quite run right (yet), but what I can say is that you guys
have pointed me in the right direction and hopefully I can keep going
from there, and hopefully towards doing some cool rotations.

Thank you guys. Now back to the grind.

On 22 abr, 15:23, Casey Duncan <[email protected]> wrote:
> Also note that the default pyglet projection is orthogonal. Rotating
> about the Y axis will not look "3D" this way, it will just look like
> the triangle is being scaled along the x-axis. Maybe this is what you
> want, but you may want a perspective projection instead. For example:
>
>   �[email protected]
>     def on_resize(width, height):
>             glViewport(0, 0, width, height)
>             glMatrixMode(GL_PROJECTION)
>             glLoadIdentity()
>             gluPerspective(70, 1.0*width/height, 0.1, 1000.0)
>             glMatrixMode(GL_MODELVIEW)
>             glLoadIdentity()
>
> hth,
>
> -Casey
>
>
>
> On Thu, Apr 22, 2010 at 4:08 PM, Txema Vicente <[email protected]> wrote:
> > May be your problem is in the projection matrix.
> > The Manual says: "The default pyglet projection has a depth range of (-1, 1)
> > -- images drawn with a z value outside this range will not be visible". You
> > are rotating a very big triangle, so you see only a tiny slice,
>
> > If you want to see the Z axis, lets say a depth range from -2000 to 2000,
> > you have to override the default handler:
>
> > @window.event
> > def on_resize(width, height):
> >     glViewport(0, 0, width, height)
> >     glMatrixMode(gl.GL_PROJECTION)
> >     glLoadIdentity()
> >     glOrtho(0, width, 0, height, -2000, 2000)
> >     glMatrixMode(gl.GL_MODELVIEW)
>
> > I think this could help you:
> >http://groups.google.com/group/pyglet-users/web/pyglet-projection-matrix
>
> > El 22/04/2010 4:31, Alejandro Castellanos escribió:
>
> > What I'm doing is basically this, so here's the code:
>
> > ------------------------------------------------------------
>
> > # -*- coding: cp1252 -*-
> > import pyglet
> > import math
> > from pyglet.gl import *
>
> > # Direct OpenGL commands to this window.
> > window = pyglet.window.Window(resizable=True)
>
> > @window.event
> > def on_draw():
> >     glClear(GL_COLOR_BUFFER_BIT)
> >     glLoadIdentity()
>
> >     #glTranslatef(50.0,0.0,0.0)#Sirve para mover la vista de la
> > ventana(o algo asi).
>
> >     rtri = 15
>
> >     glRotatef(rtri,0.0,0.0,1.0)#Rotating around Z.
> >     #glRotatef(rtri,0.0,1.0,0.0)#Rotating around Y.
> >     #glRotatef(rtri,1.0,0.0,0.0)#Rotting around X.
>
> >     #COMENZANDO A DIBUJAR EL TRIANGULO.
> >     glBegin(GL_TRIANGLES)
> >     glColor3f(1.0,0.0,0.0)#Color, justo antes del primer vertice (en
> > RGB---ROJO).
> >     glVertex3f(window.width/2,window.height,0.0)#SUPERIOR.
>
> >     glColor3f(0.0,1.0,0.0)#Color, justo antes del segundo vertice (en
> > RGB---VERDE).
> >     glVertex3f(100.0,0.0,0.0)#INFERIOR IZQUIERDO.
>
> >     glColor3f(0.0,0.0,1.0)#Color, justo antes del tercer vertice (en
> > RGB---AZUL).
> >     glVertex3f(window.width,0.0,0.0)#INFERIOR DERECHO.
> >     glEnd()
>
> > pyglet.app.run()
>
> > ------------------------------------------------------------
>
> > The triangle basically disappears if I don't use decimals in 'rtri'.
> > If I use the decimals, it is when the triangle starts getting
> > 'slashed.'
>
> > On 21 abr, 19:25, Greg Ewing <[email protected]> wrote:
>
> > On 22/04/10 13:21, Alejandro Castellanos wrote:
>
> > But I'm having to use  glRotatef(rtri, 0.0, 0.0, 1.0); which, yet
> > again, rotates around the Z axis but 'slashes' the figure if I attempt
> > to rotate around X or Y.
>
> > You'll have to show us the code you're using to rotate
> > about the other axes.
>
> > It should be something like
>
> > glRotatef(rtri, 1.0, 0.0, 0.0) # x-axis
> > glRotatef(rtri, 0.0, 1.0, 0.0) # y-axis
>
> > As for the "slashing", it sounds like the triangle
> > is getting clipped by something, maybe the near or
> > far plane. It might be that the triangle is actually
> > getting rotated correctly, but you're having trouble
> > seeing it because of clipping.
>
> > --
> > Greg
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "pyglet-users" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group
> > athttp://groups.google.com/group/pyglet-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "pyglet-users" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/pyglet-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "pyglet-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/pyglet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to