Loading Blender3D

Started by
2 comments, last by liquidAir 20 years, 10 months ago
Where can I get tutorials on how to load stuff designed with Blender3D into an OpenGL scene using C++?
Advertisement
all you need is that file format specification.
there are loads of prewrittens scripts that you allow to expert blender objects to various formats.

I personally have used the obj export script. Visit www.elysiun.com and go to the scripts forums and ask there for the location of the obj export script.

After that, I''m sure you could find any number of tuts on loading obj model data into OpenGL.
Open the script window in Blender and type this Python shit:

import Blender
from Blender import Scene, Object, Mesh
import sys
file = open("model.mdl", "w")
for obj in Object.get():
if obj.getType() == "Mesh":
m = obj.getData()
for dummie in m.vertices:
i = i + 1
file.write("NumberOfVertices %i" % i )
for vert in m.vertices:
file.write("%f %f %f"%(vert[0],vert[1],vert[2]))

file.close()


Then you have all the vertices saved into a file or sumthin.. That''s a start at least. Take a look at the web to find more exporterscripts and how to write them (www.google.com)
----------------------------------------------Petter Nordlander"There are only 10 kinds of people in the world. They who understand binary and those who do not"

This topic is closed to new replies.

Advertisement