COB importer for Poser 7

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

COB importer for Poser 7 // Archive: Tech Forum

1  |  

Post by PhilC // Aug 30, 2007, 2:09pm

PhilC
Total Posts: 5
pic
Hi Folks,


I've spent the day creating a COB importer for Poser 7.


I've got the geometry, grouping, material groups and UV data all behaving themselves, I'm now looking at the actual material values. Does any one have information as to what line in the COB file relates to what Poser material parameter and/or the equivalent in an wavefront MTL file? I've got a fair bit sorted out but I find that I'm now beginning to take guesses and that is probably not good :)


When its done I'll be putting it out as a freebie.

Post by Jack Edwards // Aug 30, 2007, 3:59pm

Jack Edwards
Total Posts: 4062
pic
I'm sure there will be a lot of people happy to see this :)

Only help I can offer you at the moment is:
http://www.caligari.com/download/tsx.asp?Cate=DTSX

But this might be something that you'll want to contact Caligari directly. The devs should be able to help you with specific problems. ;) Keep in mind though that different programs handle materials differently so not everything will have a 1:1 conversion and you'll have to just choose to substitute poser things that you feel would be equivalent.

-Jack.

Post by PhilC // Sep 3, 2007, 1:58am

PhilC
Total Posts: 5
pic
Thanks, that is exactly what I was looking for.


Now I've got to figure out how to apply the transformation matrices :)

Post by PhilC // Sep 3, 2007, 8:33am

PhilC
Total Posts: 5
pic
'''

################################################

Task:-

to apply a translation array to an array

of 3D vertex coordinates to produce the

resulting location of each vertices.


Translation array and vertex coordinates taken from

a Truespace COB file.


The text in the COB file looks like this:-


Transform

-2.11786 -0.817596 0.946387 0.864939

0.405189 1.25484 2.11894 0.434915

-1.16679 1.9198 -0.981965 1.13894

0 0 0 1

World Vertices 8

-0.200000 -0.029486 -0.236313

0.200000 0.029486 -0.163687

-0.200000 0.370514 -0.282911

-0.200000 0.370514 0.117089

-0.200000 -0.029486 0.163687

0.200000 0.029486 0.236313

0.200000 0.429486 -0.210286

0.200000 0.429486 0.189714


###############################################

'''

# script start


import Numeric



transArray = Numeric.array((

(-2.11786, -0.817596, 0.946387, 0.864939),

(0.405189, 1.25484, 2.11894, 0.434915),

(-1.16679, 1.9198, -0.981965, 1.1389),

(0, 0, 0, 1)

))


# a "1" added to the end of each set of vertix coordinates

vertArray = Numeric.array((

(-0.200000, -0.029486, -0.236313, 1),

(0.200000, 0.029486, -0.163687, 1),

(-0.200000, 0.370514, -0.282911, 1),

(-0.200000, 0.370514, 0.117089, 1),

(-0.200000, -0.029486, 0.163687, 1),

(0.200000, 0.029486, 0.236313, 1),

(0.200000, 0.429486, -0.210286, 1),

(0.200000, 0.429486, 0.189714, 1)

))


print transArray

print ""

print vertArray

print ""


transArray = Numeric.reshape(transArray,(4,4))

vertArray = Numeric.reshape(vertArray,(4,8))


print Numeric.matrixmultiply(transArray,vertArray)


# script end

'''

################################################## ################

Result:-


[[ 0.5708016 0.10309048 0.70481144 -1.12413 0.1022124 0.03400637 0.63866924 -1.12413 ]

[-0.6688108 0.57729922 -0.19537307 4.213884 0.3408408 0.72615216 0.66384632 4.213884 ]

[ 0.273571 1.26381257 -0.66763452 0.909945 -0.585931 1.13709619 0.39979 0.909945 ]

[ 0.2 0.429486 -0.210286 1. 0.2 0.429486 0.189714 1. ]]


Am I going in the right direction?

What do I do with the result? :)


Thanks,


PhilC

'''

Post by PhilC // Sep 4, 2007, 3:43am

PhilC
Total Posts: 5
pic
I've uploaded the first beta version to this page (http://www.philc.net/forum/viewtopic.php?p=6897).


I'd be greatful for any feedback. Particularly regarding how to apply the transformation matrices.


Thanks,


PhilC

Post by Jack Edwards // Sep 4, 2007, 5:29am

Jack Edwards
Total Posts: 4062
pic
Very cool PhilC. :)

I don't have Poser, or I'd test it out for you. ;)

Post by Burnart // Sep 4, 2007, 12:56pm

Burnart
Total Posts: 839
pic
Thanks PhilC - I've downloaded from work but I'll try to remember to give it a go when I get home.
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn