Tag Info

Hot answers tagged

8

Some Options for Python: Multiplatform (Win/Linux/Mac): PyInstaller Multiplatform (Win/Linux/Max): cx-freeze Windows: py2exe Mac: py2app The bad news is that, as far as I can tell, you can't create binaries for a platform from another platform. The reason seems to be dependencies on platform-specific libraries. Edit: By the way, you might be interested ...


6

Pygame doesn't even have OpenGL bindings; you'd need to use PyOpenGL with it. If your goal is to learn OpenGL, my suggestion would be to use PyOpenGL, with Pygame. The API is closer to actual OpenGL. (I'd also recommend not using NeHe and using the SuperBible instead.) If your goal is to make a quick game, I'd recommend pyglet. It has all the annoying ...


4

At the request of commenters... Warning to Pyglet professionals: There may be a nice Pyglet way to do this, and this isn't it. It's a nice OpenGL way. You have been warned! You can do this in OpenGL by first binding the texture, then calling glTexParameteri or similar varients. You can do this in Pyglet by importing OpenGL: from pyglet.gl import * You ...


4

The concept of a surface in this situation is simply describing a texture. To understand this better, you should also understand the rendering process. When rendering anything using modern graphics API's, the end result is always going to be the same, a buffer (texture) of color data that is presented to the screen. How you get to that buffer can vary quite ...


4

Just use the maximum height of the window for your calculations: When setting: py_Y_Value = max_Screen_Height - my_Y_Value or when getting: my_Y_Value = max_Screen_Height - py_Y_Value The best way to utilize these would be to abstract away their use in wrapper functions.


4

pyglet has a mailing list but no active web presence (or development at all) right now. In general people working on pyglet code are encouraged to submit to pygame.org, and many also participate in PyWeek; there are many completed pyglet games there, although because of the time pressure the code is usually not great, even when the programmers are skilled.


2

I tried out billboards a while back. I just created a quad that faced the camera. Using the position I want the object at and the up and right vectors (normalized) of the camera, you can set the four corners of the quad like so: a = position - ((right + up) * scale); b = position + ((right - up) * scale); c = position + ((right + up) * scale); d = position ...


1

There were no normals, so nothing was displaying. I updated the git repo to warn on missing normals. Unfortunately, I have no ground-breaking debugging techniques to report. I opened up the working .obj file and the "broken" .obj file, and by comparing them I noticed that one of the files had normals, and the other one didn't.


1

I use my own sprite class, which has an timer variable which accumulates the dtime in the update_frames() message. By this you have an exact timestamp and can easily change the image based on certain timings.I do not have a source available but I will add this later, if needed Update: Here is a small piece of code: It loads two frames and displays flip flop ...


1

Ended up figuring out the answer myself through trial and error, solution follows. You need to import openGL to get access to the scaling function: from pyglet.gl import * Next, toss in the following code after your game's window has been initialized: #These arguments are x, y and z respectively. This scales your window. glScalef(2.0, 2.0, 2.0) At ...



Only top voted, non community-wiki answers of a minimum length are eligible