[bleeding]Actor scale

Dutchie

07-04-2008 18:40:37

In another topic is mentioned to create a triangle mesh by using flour and than add it by creating a new actor(actor is chosen because the node with entity is made different and it will only be static). But what params do i have to set to scale down the mesh?

in either ActorParams and ShapeParams i can't find scale.




btw betajean i created the batch file we spoke about in the terrain topic. it converts all the meshes from one directory adds it to an other directory and updates an xml file with all the triangle meshes.

betajaen

07-04-2008 18:54:52

I haven't implemented scaling into the Mesh class yet. To do it, the mesh needs to be converted to a Description, the vertices scaled then cooked again. It isn't hard to do, it's just fiddly.

For now, I just recommend to scale them using MeshMagick then convert them using flour.

You should post that batch file, I'm sure many people would want to use it.

Dutchie

07-04-2008 21:20:53

I have done it like this:

convert.bat
for %%i in (triangle\*) do flour.exe meshes type: triangle, in: %%i, out: Release\%%i.nxs
pause
addtriangle.exe
pause
for %%i in (triangle\*) do addtriangle.exe %%i.nxs


in the triangle dir are all the meshes that need to be converted. it calls flour.exe for every file in the triangle dir. flour will create the nxs file and place it in the Release\triangle directory and appends .nxs to it.
after that(pressing a button, done that for debug) it will call an own written tool to clear a file called triangle.xml, which contains all names of triangle shapes. After that for every file in the triangle folder the addtriangle program is called with a parameter to add the triangle files to the xml file.

In my project for the game i read out the triangle.xml and write all the triangle nxses to the NxOgre resource system.


But since you say that you have to scale down the mesh and than convert it i have to rethink everything. At this moment i have an converter to convert .scene files created by the ogremax exporter to an obj file i use. than convert the meshes i get with this script and than add it to the game. in the obj file(and thus the scene file) there is a scale object. So i have to call MeshMagick to convert the mesh to a scaled one, than convert it to a nxs mesh and remove the scale from the file... okay, lets think about that :P

thanks for the clearification and your work on NxOgre