Crystal Space
Welcome, Guest. Please login or register.
December 29, 2014, 04:57:14 pm

Login with username, password and session length
Search:     Advanced search
9032 Posts in 2046 Topics by 9325 Members
Latest Member: Maryannterry
* Home Help Search Login Register
  Show Posts
Pages: [1]
1  Crystal Space Development / Support / Re: Can't read a blender model - what to do? on: August 13, 2011, 01:48:20 pm
Thanks.
I used the 1.4 stable download, that didn't contain the file you described.
I downloaded the latest version from SVN and that does contain the terrainpnp.zip file. I will try again.
2  Crystal Space Development / Support / Re: Can't read a blender model - what to do? on: August 08, 2011, 11:05:55 pm
An extra question:
does the project contain an example xml world file that uses the terrain2 engine?
the normal terrain engine world file example from the manual crashed and said the terrain renderer was deprecated. It would help if I have a working world xml file to modify.
3  Crystal Space Development / Support / Re: Can't read a blender model - what to do? on: August 08, 2011, 10:25:50 pm
Ok, the loading-a-sprite part of the manual tells how to add it to the engine.
It loads and shows, but it's black.

Code:
// load shader.
csRef<iShader> shader = loader->LoadShader("/shader/std_lighting.xml");
csRef<iMaterialWrapper> rots01 = engine->CreateMaterial("rots01", 0);
rots01->GetMaterial()->SetShader(  0, shader);

// load texture:
iTextureWrapper* txt = loader->LoadTexture ("green", "/rob/green.png");
if (!txt)
ReportError("Error loading texture!");

// load model
csRef<iMeshFactoryWrapper> ff  = modelloader->Load ("factory_rotsen", "/rob/rotsen.3ds");

// Add the model to the engine.
csRef<iMeshWrapper> sprite (engine->CreateMeshWrapper (ff, "sprite_rotsen", room, csVector3 (-3, 5, 3)));
4  Crystal Space Development / Support / Re: Can't read a blender model - what to do? on: August 08, 2011, 09:52:37 pm
I got rid of errors by doing this (I noticed in a world file that shaders are defined in files):

Code:
csRef<iShader> shader = loader->LoadShader("/shader/std_lighting.xml");

csRef<iMaterialWrapper> rots01 = engine->CreateMaterial("rots01", 0);
rots01->GetMaterial()->SetShader(  0, shader);

iTextureWrapper* txt = loader->LoadTexture ("green", "/rob/green.png");
if (!txt)
ReportError("Error loading texture!");

csRef<iMeshFactoryWrapper> ff  = modelloader->Load ("rotsen", "/rob/rotsen.3ds");

But I don't know how to add this to the engine so that it's displayed.
5  Crystal Space Development / Support / Can't read a blender model - what to do? on: August 07, 2011, 09:36:53 pm

Hello, I want to try out crystal space, without using a map file; I just want to load a simple model, not an entire map. I intend ultimately to read a heighmap-terrain and place a few (random) trees and rocks on it. And then perhaps a moving object, if it all works.

For starters, I read through the "simple" manual, followed all the steps and got a brick wall on a console screen.

Then I made a simple model in blender (2.58).

I exported it to 3ds format.

The manual states, that I can import this file, but that I need to import the textures and materials separately.

According to the manual, the texture is can be loaded as: loader->LoadTexture ("green", "/rob/green.png");

The material is a problem. I defined a material in blender, but I cannot find it after the 3ds export.
The material in this case is just a shader setting, so I wanted to add a shader programmaticaly with the same name as the missing material.

I got stuck here:

csRef<iMaterial> rots01 = engine->CreateBaseMaterial(0);
rots01->SetShader( .. ?

At this moment, I'm not sure if this is the right way of doing this. I'd like to know if it's ok, as much as which setting I could use here.

On a sidenote, I doubt the model will be recognized by the engine after these calls, but I couldn't find a function to bind them to the engine. Is there such a function?

Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 3.107 seconds with 17 queries.