Connect Blender + OpenGL + Python

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

pollopippo
Posts: 2
Joined: Fri Aug 24, 2012 8:28 am

Connect Blender + OpenGL + Python

Postby pollopippo » Fri Aug 24, 2012 8:34 am

Hi.
I don't understand how to connect Blender + OpenGL + Python.
I have create a cube 3d in blender.
Now i want to use this cube in my python script in which use opegl to move the cube.
IN particular I use the OpenGL functions:
- glRotatef
- glTranslatef
- glScalef
Can i make this???
Help please! :(

CoDEmanX
Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Postby CoDEmanX » Fri Aug 24, 2012 11:10 pm

what's the target environment?

do you want to animate the cube inside of blender, rendering it later to a video?

do you have an OpenGL application (like written in C++ or C#) and want to import models from blender?
I'm sitting, waiting, wishing, building Blender in superstition...

pollopippo
Posts: 2
Joined: Fri Aug 24, 2012 8:28 am

Postby pollopippo » Fri Aug 31, 2012 11:41 am

HI!
I want animate the cube in my python script (in which use openGL library).
My application is in Python and i want import cube in this my script..... when i want to rotate the cube.
My problem is: can i use blender cube in python script and animate this cube normally with OpenGL? How?
Thanks!

CoDEmanX
Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Postby CoDEmanX » Fri Aug 31, 2012 10:49 pm

if i got you right, you coded a python application which draws 3d content in a window using opengl.

i would export a cube / models to a common format like OBJ and write an importer for mesh geometry for your app (i bet there are examples on the web)

you could then use any opengl features i guess
I'm sitting, waiting, wishing, building Blender in superstition...


Return to “Python”

Who is online

Users browsing this forum: No registered users and 2 guests