Crystal Space
Welcome, Guest. Please login or register.
March 25, 2017, 08:51:26 pm

Login with username, password and session length
Search:     Advanced search
8993 Posts in 2044 Topics by 32439 Members
Latest Member: Devnorma728
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Game Content Creation
| | |-+  Library texture loading
« previous next »
Pages: [1] Print
Author Topic: Library texture loading  (Read 4168 times)
Posts: 47

View Profile Email
« on: November 02, 2007, 11:53:59 pm »

Hello I have a library file, extracted from a blender2crystal created world zipfile. From this library my program loads a meshfactory:

<texture name='ASHSEN_2.jpg'>
<material name='MaterialASHSEN_2.jpg'>
<meshfact name='pointer'>
<v x="1" y="0.25" z="-1" u="0.000000" v="-1.000000" nx="0.4756" ny="0.78341" nz="-0.400006"/>
<v x="1" y="-0.25" z="-1" u="0.000000" v="0.000000" nx="0.4756" ny="-0.78341" nz="-0.400006"/>
<v x="1.78814e-007" y="-0.25" z="1" u="1.000000" v="0.000000" nx="0" ny="-0.91287" nz="0.408246"/>
<v x="2.68221e-007" y="0.25" z="1" u="1.000000" v="-1.000000" nx="0" ny="0.91287" nz="0.408246"/>
<t v1="3" v2="2" v3="1"/>
<t v1="3" v2="1" v3="0"/>
<v x="-1" y="-0.25" z="-1" u="0.000000" v="-1.000000" nx="-0.4756" ny="-0.78341" nz="-0.400006"/>
<v x="-1" y="0.25" z="-1" u="0.000000" v="0.000000" nx="-0.4756" ny="0.78341" nz="-0.400006"/>
<v x="2.68221e-007" y="0.25" z="1" u="1.000000" v="0.000000" nx="0" ny="0.91287" nz="0.408246"/>
<v x="1.78814e-007" y="-0.25" z="1" u="1.000000" v="-1.000000" nx="0" ny="-0.91287" nz="0.408246"/>
<t v1="7" v2="6" v3="5"/>
<t v1="7" v2="5" v3="4"/>
<v x="1" y="-0.25" z="-1" u="0.999996" v="-0.940477" nx="0.4756" ny="-0.78341" nz="-0.400006"/>
<v x="2.23517e-007" y="-0.25" z="-0.7" u="0.499998" v="-0.758794" nx="0" ny="-0.72216" nz="-0.691702"/>
<v x="1.78814e-007" y="-0.25" z="1" u="0.499998" v="0.000000" nx="0" ny="-0.91287" nz="0.408246"/>
<t v1="10" v2="9" v3="8"/>
<v x="-1" y="-0.25" z="-1" u="0.000000" v="-0.940477" nx="-0.4756" ny="-0.78341" nz="-0.400006"/>
<t v1="10" v2="11" v3="9"/>
<v x="-1" y="0.25" z="-1" u="0.000000" v="-0.000000" nx="-0.4756" ny="0.78341" nz="-0.400006"/>
<v x="-2.23517e-007" y="0.25" z="-0.7" u="0.499998" v="-0.181683" nx="0" ny="0.72216" nz="-0.691702"/>
<v x="2.68221e-007" y="0.25" z="1" u="0.499998" v="-0.940477" nx="0" ny="0.91287" nz="0.408246"/>
<t v1="14" v2="13" v3="12"/>
<v x="1" y="0.25" z="-1" u="0.999996" v="0.000000" nx="0.4756" ny="0.78341" nz="-0.400006"/>
<t v1="14" v2="15" v3="13"/>
<v x="2.23517e-007" y="-0.25" z="-0.7" u="0.000000" v="-1.000000" nx="0" ny="-0.72216" nz="-0.691702"/>
<v x="1" y="0.25" z="-1" u="1.000000" v="0.000000" nx="0.4756" ny="0.78341" nz="-0.400006"/>
<v x="-2.23517e-007" y="0.25" z="-0.7" u="1.000000" v="-1.000000" nx="0" ny="0.72216" nz="-0.691702"/>
<t v1="18" v2="17" v3="1"/>
<t v1="18" v2="1" v3="16"/>
<v x="-2.23517e-007" y="0.25" z="-0.7" u="0.000000" v="-1.000000" nx="0" ny="0.72216" nz="-0.691702"/>
<v x="-1" y="-0.25" z="-1" u="1.000000" v="0.000000" nx="-0.4756" ny="-0.78341" nz="-0.400006"/>
<v x="2.23517e-007" y="-0.25" z="-0.7" u="1.000000" v="-1.000000" nx="0" ny="-0.72216" nz="-0.691702"/>
<t v1="21" v2="20" v3="5"/>
<t v1="21" v2="5" v3="19"/>

However, the program seems to be unable to load the jpg file that is in the same directory as the library. Can someone please tell me how to get that jpg loaded for my factory?
Hero Member
Posts: 1706

View Profile
« Reply #1 on: November 03, 2007, 05:54:35 am »

Can you show me the code you use to load the library?

Make sure you use vfs->ChDir() to go to the right directory before loading the library as your paths in the file are relative.

Posts: 47

View Profile Email
« Reply #2 on: November 03, 2007, 09:56:41 am »

Using vfs->ChDir() already solves my problem, thanx.
Pages: [1] Print 
« previous next »
Jump to:  

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.207 seconds with 15 queries.