Re: [cgkit-user] Importing .3ds meshes
Brought to you by:
mbaas
|
From: Matthias B. <mat...@gm...> - 2007-07-10 19:28:38
|
Rodrigo Culagovski wrote:
> new to the list, cgkit newbie, would greatly appreciate help with the
> folowing:
>
> 1. Importing a 3ds (or dxf, or .skp, not picky) file as a TriMeshGeom
> object.
> 2. Visualizing it,
The easiest way to do that is using the viewer tool:
viewer.py my_scene.3ds
This will load the file and visualize it using OpenGL.
> 3. Accessing the geometry (specifically, to run intersectRay() on it).
from cgkit.all import *
load("my_model.3ds")
model = worldObject("model_name")
model.geom.intersectRay((1,2,3), (0,1,0))
You can find out the name of your geometry by calling listWorld() after
loading the model which will dump the names of the objects in the
current scene.
If you do all that from within a script that is invoked using the viewer
tool you could omit the first two lines (i.e. the import and load()) and
pass the file name on the command line.
The load(), worldObject() and listWorld() functions are mentioned here:
http://cgkit.sourceforge.net/doc2/commands.html
- Matthias -
|