OpenGL tinkering
1 Attachment(s)
I've been experimenting with openGL (using pyOpenGL for python)
So far I've managed to get a textured cube to rotate. I've got my code and a screen shot attached in the zip file. As you can see on the screenshot, there are strange things going on at the edges of the cubes. Does anyone know of a likely cause/solution? Next I'm going to try to display an .obj file. |
I've finished my class to load and display .obj files. It works on some models but doesn't work on anything I export and I get a rather strange error:
Code:
Traceback (most recent call last): |
well from the traceback it appears things start to go south starting at line 60 and the error does not seem to be with the .obj file at that point but with hashing the path "/" character.
|
Well it's not necessarily the / character itself, but that you've got a NoneType (essentially nothing) when it's expecting a string or something like that. Basically I don't think the .obj is getting passed in correctly, but I think you already knew that. Could you try with a simple cube or something?
|
I tried it with a cube and got the same error, but I tried it with someone else's model and it did work. I wonder if Maya does something my program doesn't like.
I'll go back to the cube and see if I can find anything strange in there. Code:
texture_path = os.path.join(model_path, material.texture_fname) edit: :attn: I've got it to work. It didn't like the fact that no texture was specified. Thanks for the help. :beer: |
1 Attachment(s)
Here's my elephanilla model rendered using my program:
As you can see, all the duplicated features (eyes, tusks etc.) don't seem to display properly. So far I've had no luck figuring out what's causing it. It seems that the half facing away from the camera (that shouldn't be drawn) is being draw but the half that is facing the camera isn't being. After a bit of testing, it seems to happen when I duplicate/mirror the features. If I duplicate with out mirroring them, they display fine. Reversing the normals seems to fix it but messes up the lighting edit: After freezing transformation and reversing normals, it displays correctly! Now I'm going to add some camera controls and then I'll try and make it a bit less picky. |
You've always got to remember to freeze transforms and delete history, and set the normals before taking into any realtime app.
|
All times are GMT. The time now is 10:12 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018