Page 2 of 2

Posted: Wed Jul 16, 2008 2:04 pm
by JensAyton
Griff wrote:
re: making objects appear more rounded, you could try using the the 'smooth' option in the shipdata .plist, it gets oolite to recalculate the lighting on the model a bit differently than normal, works great on more 'organic' shapes like asteroids, but also looks cool on sphere's, cylinders etc.
To understand what smooth in shipdata.plist actually means, I suggest reading the Wikipedia article on Gouraud shading. yes, it uses funny words like “surface normal”, but understanding such concepts will make you a better modeller.

The weakness in interpolation mentioned in that text (and demonstrated in the animation) does not apply to Oolite when shaders are enabled (the default shader uses Phong interpolation), but the averaging of surface normals remains the same. In particular, this means that using smooth in models with sharp corners (as seen in Commies.oxp, for instance) does not provide any “smoothness”, it just produces a horrible mess.

Posted: Wed Jul 16, 2008 2:09 pm
by JensAyton
Frame wrote:
Also with smoothing you have to be very carefull, at some 90 and above degree bends you might not want it to smooth, while oolite offers no way of setting smooth groups.
Not true. Smoothing groups are supported since Oolite 1.65 and in the current version of Obj2DatTex.py. You can also specify smooth groups by editing the DAT file. The first number for each face is the smooth group (127 by default). 0 is supposed to mean no smoothing, but I don’t think it works.

Posted: Wed Jul 16, 2008 2:11 pm
by Amen Brick
You can go up to 375 surfaces and 580 vertices (assuming nontessulated) in wings (if you go to the 500/800 limit, the model won't work as the dat conversion triangulates automatically adding faces and verts).

Remember, you don't have to smooth the entire model (you can choose multiple faces) and if you do and it goes over the safe numbers above, you can alway try deleting lines from safe areas, constantly checking to make sure you haven't broken the mesh (its best to have the whole model highlighted sometimes to glimpse holes in the mesh).

Edit: To answer your original question, I find just hardening the lines (lines>hardness>hard) is a near enough approximation.

Posted: Wed Jul 16, 2008 2:25 pm
by Davidtq
Now Ive got python and obj2dattex.py working I can dump models in game dead easy :D Im now wondering if the basic ship actually needs to look round :D but I can now play as much as I like with it all, no need for a mac.

Will play with the smoothing options and see what I get will see what I get from higher poly stuff, and might have a look at other 3d programs as well. Im quite liking creating ships.

grrr

Posted: Wed Jul 16, 2008 2:52 pm
by Frame
Ahruman wrote:
Frame wrote:
Also with smoothing you have to be very carefull, at some 90 and above degree bends you might not want it to smooth, while oolite offers no way of setting smooth groups.
Not true. Smoothing groups are supported since Oolite 1.65 and in the current version of Obj2DatTex.py. You can also specify smooth groups by editing the DAT file. The first number for each face is the smooth group (127 by default). 0 is supposed to mean no smoothing, but I don’t think it works.
Then the conversion tool does not preserve the smoothing groups, as it just slams everything into smooth group 127

I just tested that with a simple sphere with 4 smoothgroups, i countercheck the obj file too see if these smooth groups where preserved.

There are, at least there are small "s" corrorsponding to the smooth groups i made ..

But these appears to get lost in the conversion... SO i opened the python script to have a look, and i find this...

Code: Select all

faces_lines_out.append('127,127,127,\t%.5f,%.5f,%.5f,\t3,\t%d,%d,%d\n' % (norm[0],norm[1],norm[2],v1,v2,v3))
it just defaults to 127.. no conversion

and as i understand it when i read the python script comments

Code: Select all

Colour for the faces is set to flat grey (127,127,127)
this has nothing todo with smooth groups... so i´m rather confused now...

:S

for completeness here is the entire pythonscript

Obj2DatTex.py

Code: Select all

#!/usr/bin/python

"""
This script takes a Wavefront .obj file
and exports a .dat file containing the same trimesh.

Colour for the faces is set to flat grey (127,127,127)
and surface normals calculated for each triangle.
"""

import sys, string, math

inputfilenames = sys.argv[1:]
print "converting..."
print inputfilenames
for inputfilename in inputfilenames:
	outputfilename = inputfilename.lower().replace(".obj", ".dat")
	if (outputfilename == inputfilename):
		outputfilename = outputfilename,append(".1")
	print inputfilename+"->"+outputfilename
	inputfile = open( inputfilename, "r")
	lines = inputfile.read().splitlines(0)
	outputfile = open( outputfilename, "w")
	mode = 'SKIP'
	vertex_lines_out = ['VERTEX\n']
	faces_lines_out = ['FACES\n']
	n_verts = 0
	n_faces = 0
	skips = 0
	vertex=[]
	uv=[]
	face=[]
	texture=[]
	uvForVertex=[]
	uvsForTexture={}
	textureForFace=[]
	uvsForFace=[]
	textureCounter = 0
	interpretTexture = 0
	materials = {}
	max_v = [0.0, 0.0, 0.0]
	min_v = [0.0, 0.0, 0.0]
	# find materials from mtllib
	for line in lines:
		tokens = string.split(line, ' ')
		if (tokens[0] == 'mtllib'):
			path = string.split(inputfilename, '/')
			path[-1] = tokens[1]
			materialfilename = string.join(path,'/')
			print "going to open material library file: %s" % materialfilename
			infile = open( materialfilename, "r")
			mlines = infile.read().splitlines(0)
			newMaterial = 0
			for mline in mlines:
				tokens1 = string.split(mline, ' ')
				if (tokens1[0] == 'newmtl'):
					newMaterialName = tokens1[1]
					newMaterial = 1
				if (tokens1[0] == 'map_Kd'):
					if (newMaterial):
						materials[newMaterialName] = tokens1[1]
						print "Material %s -> %s" % (newMaterialName, tokens1[1])
					newMaterial = 0
	#print "materials :"
	#print materials
	# find geometry vertices first
	for line in lines:
		tokens = string.split(line, ' ')
		if (tokens[0] == 'v'):
			n_verts = n_verts + 1
	#		x = float(tokens[1])
	# negate x value for vertex to allow correct texturing...
			x = -float(tokens[2])
			y = float(tokens[3])
			z = float(tokens[4])
			vertex.append( ( x, y, z) )
			vertex_lines_out.append('%.5f, %.5f, %.5f\n' % ( x, y, z))
			if (x > max_v[0]):
				max_v[0] = x
			if (y > max_v[1]):
				max_v[1] = y
			if (z > max_v[2]):
				max_v[2] = z
			if (x < min_v[0]):
				min_v[0] = x
			if (y < min_v[1]):
				min_v[1] = y
			if (z < min_v[2]):
				min_v[2] = z
	#print "vertex:"
	#print vertex, len(vertex), n_verts
	#print "\n"
	# find texture coordinates next
	for line in lines:
		tokens = string.split(line, ' ')
		if (tokens[0] == 'vt'):
			uv.append( ( float(tokens[2]), 1.0 - float(tokens[3])) )
	#print "uv:"
	#print uv, len(uv), n_verts
	#print "\n"
	# find faces next
	for line in lines:
		tokens = string.split(line, ' ')
		if (tokens[0] == 'usemtl'):
			textureName = tokens[1]
			if (materials.has_key(textureName)):
				textureName = materials[textureName]
			interpretTexture = 1
			texture.append(textureName)
			uvsForTexture[textureName] = n_verts * [[]]
		if (tokens[0] == 'f'):
			#print "line: %s" % line
			while (len(tokens) >=4):
				bits = string.split(tokens[1], '/')
				v1 = int(bits[0]) - 1
				if (bits[1] > ''):
					vt1 = int(bits[1]) - 1
				bits = string.split(tokens[2], '/')
				v2 = int(bits[0]) - 1
				if (bits[1] > ''):
					vt2 = int(bits[1]) - 1
				bits = string.split(tokens[3], '/')
				v3 = int(bits[0]) - 1
				if (bits[1] > ''):
					vt3 = int(bits[1]) - 1
				else:
					interpretTexture = 0
				#print "face (geometry): %d %d %d" % (v1, v2, v3)
				#print "face (textures): %d %d %d\n" % (vt1, vt2, vt3)
				d0 = (vertex[v2][0]-vertex[v1][0], vertex[v2][1]-vertex[v1][1], vertex[v2][2]-vertex[v1][2])
				d1 = (vertex[v3][0]-vertex[v2][0], vertex[v3][1]-vertex[v2][1], vertex[v3][2]-vertex[v2][2])
				xp = (d0[1]*d1[2]-d0[2]*d1[1], d0[2]*d1[0]-d0[0]*d1[2], d0[0]*d1[1]-d0[1]*d1[0])
				det = math.sqrt(xp[0]*xp[0] + xp[1]*xp[1] + xp[2]*xp[2])
				if (det > 0):
					n_faces = n_faces + 1
				#	norm = (xp[0]/det, xp[1]/det, xp[2]/det)
				# negate the normal to allow correct texturing...
					norm = ( -xp[0]/det, -xp[1]/det, -xp[2]/det)
					face.append((v1,v2,v3))
					faces_lines_out.append('127,127,127,\t%.5f,%.5f,%.5f,\t3,\t%d,%d,%d\n' % (norm[0],norm[1],norm[2],v1,v2,v3))
					if (interpretTexture):
						textureForFace.append(textureName)
						uvsForTexture[textureName][v1] = uv[vt1]
						uvsForTexture[textureName][v2] = uv[vt2]
						uvsForTexture[textureName][v3] = uv[vt3]
						uvsForFace.append([ uv[vt1], uv[vt2], uv[vt3]])
				tokens = tokens[:2]+tokens[3:]
	# begin final output...
	outputfile.write('// output from Obj2DatTex.py Wavefront text file conversion script\n')
	outputfile.write('// (c) 2005 By Giles Williams\n')
	outputfile.write('// \n')
	outputfile.write('// original file: "%s"\n' % inputfilename)
	outputfile.write('// \n')
	outputfile.write('// model size: %.3f x %.3f x %.3f\n' % ( max_v[0]-min_v[0], max_v[1]-min_v[1], max_v[2]-min_v[2]))
	outputfile.write('// \n')
	outputfile.write('// textures used: %s\n' % uvsForTexture.keys())
	outputfile.write('// \n')
	outputfile.write('NVERTS %d\n' % n_verts)
	outputfile.write('NFACES %d\n' % n_faces)
	outputfile.write('\n')
	outputfile.writelines(vertex_lines_out)
	outputfile.write('\n')
	outputfile.writelines(faces_lines_out)
	outputfile.write('\n')
	# check that we have textures for every vertex...
	okayToWriteTexture = 1
	#print "uvsForTexture :"
	#print uvsForTexture
	#print "uvsForFace :"
	#print uvsForFace
	if (len(textureForFace) != len(face)):
		okayToWriteTexture = 0
	if (len(uvsForFace) != len(face)):
		okayToWriteTexture = 0
	for texture in textureForFace:
		if (texture == ''):
			okayToWriteTexture = 0
	# if we're all clear then write out the texture uv coordinates
	if (okayToWriteTexture):
		outputfile.write('TEXTURES\n')
		for i in range(0, len(face)):
			facet = face[i]
			texture = textureForFace[i]
			uvForVertex = uvsForTexture[texture]
			outputfile.write('%s\t1.0 1.0\t%.5f %.5f\t%.5f %.5f\t%.5f %.5f\n' % (texture, uvsForFace[i][0][0], uvsForFace[i][0][1], uvsForFace[i][1][0], uvsForFace[i][1][1], uvsForFace[i][2][0], uvsForFace[i][2][1]))
	outputfile.write('\n')
	outputfile.write('END\n')
	outputfile.close();
print "done"
print ""
#
#	end
#

Re: grrr

Posted: Wed Jul 16, 2008 4:22 pm
by JensAyton
Frame wrote:
Then the conversion tool does not preserve the smoothing groups, as it just slams everything into smooth group 127
I linked to the current version for a reason.

Re: grrr

Posted: Wed Jul 16, 2008 4:42 pm
by Frame
Ahruman wrote:
Frame wrote:
Then the conversion tool does not preserve the smoothing groups, as it just slams everything into smooth group 127
I linked to the current version for a reason.
Sry, overlooked that it was a link... :oops:

But it still does not sort everything into smooth groups... it just defaults to 127...

maybe my obj files are to blame... here is the obj file in question

Code: Select all

# Max2Obj Version 4.0 Mar 10th, 2001
#
mtllib ./sphere.mtl
g
# object Sphere01 to come ...
#
v  5.60447 40.89851 -27.12181
v  5.60447 37.78529 -42.77299
v  -0.38498 37.78529 -41.58162
v  -5.46259 37.78529 -38.18887
v  -8.85534 37.78529 -33.11126
v  -10.04671 37.78529 -27.12181
v  -8.85534 37.78529 -21.13236
v  -5.46259 37.78529 -16.05475
v  -0.38498 37.78529 -12.66200
v  5.60447 37.78529 -11.47063
v  11.59392 37.78529 -12.66200
v  16.67153 37.78529 -16.05475
v  20.06428 37.78529 -21.13236
v  21.25565 37.78529 -27.12181
v  20.06427 37.78529 -33.11126
v  16.67152 37.78529 -38.18887
v  11.59391 37.78529 -41.58162
v  5.60447 28.91961 -56.04142
v  -5.46259 28.91961 -53.84005
v  -14.84479 28.91961 -47.57106
v  -21.11377 28.91961 -38.18886
v  -23.31514 28.91961 -27.12181
v  -21.11377 28.91961 -16.05475
v  -14.84478 28.91961 -6.67255
v  -5.46258 28.91961 -0.40357
v  5.60447 28.91961 1.79780
v  16.67153 28.91961 -0.40357
v  26.05373 28.91961 -6.67256
v  32.32271 28.91961 -16.05476
v  34.52408 28.91961 -27.12181
v  32.32270 28.91961 -38.18887
v  26.05372 28.91961 -47.57107
v  16.67152 28.91961 -53.84005
v  5.60447 15.65118 -64.90710
v  -8.85534 15.65118 -62.03087
v  -21.11377 15.65118 -53.84004
v  -29.30459 15.65118 -41.58161
v  -32.18082 15.65118 -27.12181
v  -29.30459 15.65118 -12.66200
v  -21.11377 15.65118 -0.40357
v  -8.85533 15.65118 7.78725
v  5.60447 15.65118 10.66348
v  20.06428 15.65118 7.78725
v  32.32271 15.65118 -0.40358
v  40.51353 15.65118 -12.66201
v  43.38976 15.65118 -27.12181
v  40.51353 15.65118 -41.58162
v  32.32270 15.65118 -53.84005
v  20.06427 15.65118 -62.03087
v  5.60447 -0.00000 -68.02032
v  -10.04671 -0.00000 -64.90710
v  -23.31514 -0.00000 -56.04142
v  -32.18082 -0.00000 -42.77299
v  -35.29404 -0.00000 -27.12181
v  -32.18082 -0.00000 -11.47062
v  -23.31514 -0.00000 1.79781
v  -10.04671 -0.00000 10.66348
v  5.60447 -0.00000 13.77670
v  21.25566 -0.00000 10.66348
v  34.52409 -0.00000 1.79780
v  43.38976 -0.00000 -11.47063
v  46.50298 -0.00000 -27.12182
v  43.38976 -0.00000 -42.77299
v  34.52407 -0.00000 -56.04143
v  21.25564 -0.00000 -64.90710
v  5.60447 -15.65118 -64.90710
v  -8.85534 -15.65118 -62.03087
v  -21.11377 -15.65118 -53.84004
v  -29.30459 -15.65118 -41.58161
v  -32.18082 -15.65118 -27.12181
v  -29.30459 -15.65118 -12.66200
v  -21.11377 -15.65118 -0.40357
v  -8.85533 -15.65118 7.78725
v  5.60447 -15.65118 10.66348
v  20.06428 -15.65118 7.78725
v  32.32271 -15.65118 -0.40358
v  40.51353 -15.65118 -12.66201
v  43.38976 -15.65118 -27.12181
v  40.51353 -15.65118 -41.58162
v  32.32270 -15.65118 -53.84005
v  20.06427 -15.65118 -62.03087
v  5.60447 -28.91961 -56.04142
v  -5.46259 -28.91961 -53.84004
v  -14.84478 -28.91961 -47.57106
v  -21.11377 -28.91961 -38.18886
v  -23.31514 -28.91961 -27.12181
v  -21.11376 -28.91961 -16.05475
v  -14.84478 -28.91961 -6.67256
v  -5.46258 -28.91961 -0.40357
v  5.60447 -28.91961 1.79780
v  16.67153 -28.91961 -0.40358
v  26.05372 -28.91961 -6.67256
v  32.32271 -28.91961 -16.05476
v  34.52408 -28.91961 -27.12181
v  32.32270 -28.91961 -38.18887
v  26.05372 -28.91961 -47.57106
v  16.67152 -28.91961 -53.84005
v  5.60447 -37.78529 -42.77299
v  -0.38498 -37.78529 -41.58161
v  -5.46259 -37.78529 -38.18886
v  -8.85533 -37.78529 -33.11126
v  -10.04671 -37.78529 -27.12181
v  -8.85533 -37.78529 -21.13236
v  -5.46258 -37.78529 -16.05475
v  -0.38498 -37.78529 -12.66201
v  5.60447 -37.78529 -11.47063
v  11.59392 -37.78529 -12.66201
v  16.67152 -37.78529 -16.05476
v  20.06427 -37.78529 -21.13237
v  21.25565 -37.78529 -27.12181
v  20.06427 -37.78529 -33.11126
v  16.67152 -37.78529 -38.18887
v  11.59391 -37.78529 -41.58161
v  5.60447 -40.89851 -27.12181
# 114 vertices

vt  0.00000 1.00000 0.00000
vt  0.06250 1.00000 0.00000
vt  0.12500 1.00000 0.00000
vt  0.18750 1.00000 0.00000
vt  0.25000 1.00000 0.00000
vt  0.31250 1.00000 0.00000
vt  0.37500 1.00000 0.00000
vt  0.43750 1.00000 0.00000
vt  0.50000 1.00000 0.00000
vt  0.56250 1.00000 0.00000
vt  0.62500 1.00000 0.00000
vt  0.68750 1.00000 0.00000
vt  0.75000 1.00000 0.00000
vt  0.81250 1.00000 0.00000
vt  0.87500 1.00000 0.00000
vt  0.93750 1.00000 0.00000
vt  1.00000 1.00000 0.00000
vt  0.00000 0.87500 0.00000
vt  0.06250 0.87500 0.00000
vt  0.12500 0.87500 0.00000
vt  0.18750 0.87500 0.00000
vt  0.25000 0.87500 0.00000
vt  0.31250 0.87500 0.00000
vt  0.37500 0.87500 0.00000
vt  0.43750 0.87500 0.00000
vt  0.50000 0.87500 0.00000
vt  0.56250 0.87500 0.00000
vt  0.62500 0.87500 0.00000
vt  0.68750 0.87500 0.00000
vt  0.75000 0.87500 0.00000
vt  0.81250 0.87500 0.00000
vt  0.87500 0.87500 0.00000
vt  0.93750 0.87500 0.00000
vt  1.00000 0.87500 0.00000
vt  0.00000 0.75000 0.00000
vt  0.06250 0.75000 0.00000
vt  0.12500 0.75000 0.00000
vt  0.18750 0.75000 0.00000
vt  0.25000 0.75000 0.00000
vt  0.31250 0.75000 0.00000
vt  0.37500 0.75000 0.00000
vt  0.43750 0.75000 0.00000
vt  0.50000 0.75000 0.00000
vt  0.56250 0.75000 0.00000
vt  0.62500 0.75000 0.00000
vt  0.68750 0.75000 0.00000
vt  0.75000 0.75000 0.00000
vt  0.81250 0.75000 0.00000
vt  0.87500 0.75000 0.00000
vt  0.93750 0.75000 0.00000
vt  1.00000 0.75000 0.00000
vt  0.00000 0.62500 0.00000
vt  0.06250 0.62500 0.00000
vt  0.12500 0.62500 0.00000
vt  0.18750 0.62500 0.00000
vt  0.25000 0.62500 0.00000
vt  0.31250 0.62500 0.00000
vt  0.37500 0.62500 0.00000
vt  0.43750 0.62500 0.00000
vt  0.50000 0.62500 0.00000
vt  0.56250 0.62500 0.00000
vt  0.62500 0.62500 0.00000
vt  0.68750 0.62500 0.00000
vt  0.75000 0.62500 0.00000
vt  0.81250 0.62500 0.00000
vt  0.87500 0.62500 0.00000
vt  0.93750 0.62500 0.00000
vt  1.00000 0.62500 0.00000
vt  0.00000 0.50000 0.00000
vt  0.06250 0.50000 0.00000
vt  0.12500 0.50000 0.00000
vt  0.18750 0.50000 0.00000
vt  0.25000 0.50000 0.00000
vt  0.31250 0.50000 0.00000
vt  0.37500 0.50000 0.00000
vt  0.43750 0.50000 0.00000
vt  0.50000 0.50000 0.00000
vt  0.56250 0.50000 0.00000
vt  0.62500 0.50000 0.00000
vt  0.68750 0.50000 0.00000
vt  0.75000 0.50000 0.00000
vt  0.81250 0.50000 0.00000
vt  0.87500 0.50000 0.00000
vt  0.93750 0.50000 0.00000
vt  1.00000 0.50000 0.00000
vt  0.00000 0.37500 0.00000
vt  0.06250 0.37500 0.00000
vt  0.12500 0.37500 0.00000
vt  0.18750 0.37500 0.00000
vt  0.25000 0.37500 0.00000
vt  0.31250 0.37500 0.00000
vt  0.37500 0.37500 0.00000
vt  0.43750 0.37500 0.00000
vt  0.50000 0.37500 0.00000
vt  0.56250 0.37500 0.00000
vt  0.62500 0.37500 0.00000
vt  0.68750 0.37500 0.00000
vt  0.75000 0.37500 0.00000
vt  0.81250 0.37500 0.00000
vt  0.87500 0.37500 0.00000
vt  0.93750 0.37500 0.00000
vt  1.00000 0.37500 0.00000
vt  0.00000 0.25000 0.00000
vt  0.06250 0.25000 0.00000
vt  0.12500 0.25000 0.00000
vt  0.18750 0.25000 0.00000
vt  0.25000 0.25000 0.00000
vt  0.31250 0.25000 0.00000
vt  0.37500 0.25000 0.00000
vt  0.43750 0.25000 0.00000
vt  0.50000 0.25000 0.00000
vt  0.56250 0.25000 0.00000
vt  0.62500 0.25000 0.00000
vt  0.68750 0.25000 0.00000
vt  0.75000 0.25000 0.00000
vt  0.81250 0.25000 0.00000
vt  0.87500 0.25000 0.00000
vt  0.93750 0.25000 0.00000
vt  1.00000 0.25000 0.00000
vt  0.00000 0.12500 0.00000
vt  0.06250 0.12500 0.00000
vt  0.12500 0.12500 0.00000
vt  0.18750 0.12500 0.00000
vt  0.25000 0.12500 0.00000
vt  0.31250 0.12500 0.00000
vt  0.37500 0.12500 0.00000
vt  0.43750 0.12500 0.00000
vt  0.50000 0.12500 0.00000
vt  0.56250 0.12500 0.00000
vt  0.62500 0.12500 0.00000
vt  0.68750 0.12500 0.00000
vt  0.75000 0.12500 0.00000
vt  0.81250 0.12500 0.00000
vt  0.87500 0.12500 0.00000
vt  0.93750 0.12500 0.00000
vt  1.00000 0.12500 0.00000
vt  0.00000 0.00000 0.00000
vt  0.06250 0.00000 0.00000
vt  0.12500 0.00000 0.00000
vt  0.18750 0.00000 0.00000
vt  0.25000 0.00000 0.00000
vt  0.31250 0.00000 0.00000
vt  0.37500 0.00000 0.00000
vt  0.43750 0.00000 0.00000
vt  0.50000 0.00000 0.00000
vt  0.56250 0.00000 0.00000
vt  0.62500 0.00000 0.00000
vt  0.68750 0.00000 0.00000
vt  0.75000 0.00000 0.00000
vt  0.81250 0.00000 0.00000
vt  0.87500 0.00000 0.00000
vt  0.93750 0.00000 0.00000
vt  1.00000 0.00000 0.00000
# 153 texture vertices

vn  -0.19615 1.50950 -0.19615
vn  -0.00000 0.91516 -0.40309
vn  -0.15426 0.91516 -0.37241
vn  -0.28503 0.91516 -0.28503
vn  -0.37241 0.91516 -0.15426
vn  -0.26868 1.35077 -0.05344
vn  -0.37241 0.91516 0.15426
vn  -0.28503 0.91516 0.28503
vn  -0.15426 0.91516 0.37241
vn  0.00000 0.91516 0.40309
vn  0.15426 0.91516 0.37241
vn  0.28503 0.91516 0.28503
vn  0.37241 0.91516 0.15426
vn  0.26868 1.35077 0.05344
vn  0.37241 0.91516 -0.15426
vn  0.28503 0.91516 -0.28503
vn  0.15426 0.91516 -0.37241
vn  -0.00000 0.69516 -0.71886
vn  -0.27510 0.69516 -0.66414
vn  -0.50831 0.69516 -0.50831
vn  -0.66414 0.69516 -0.27510
vn  -0.77744 1.16351 -0.15464
vn  -0.66414 0.69516 0.27510
vn  -0.50831 0.69516 0.50831
vn  -0.27510 0.69516 0.66414
vn  0.00000 0.69516 0.71886
vn  0.27510 0.69516 0.66414
vn  0.50831 0.69516 0.50831
vn  0.66414 0.69516 0.27510
vn  0.77744 1.16351 0.15464
vn  0.66414 0.69516 -0.27510
vn  0.50831 0.69516 -0.50831
vn  0.27510 0.69516 -0.66414
vn  -0.00000 0.37437 -0.92728
vn  -0.35486 0.37437 -0.85670
vn  -0.65569 0.37437 -0.65569
vn  -0.85670 0.37437 -0.35485
vn  -1.19948 0.80147 -0.23859
vn  -0.85670 0.37437 0.35486
vn  -0.65569 0.37437 0.65569
vn  -0.35485 0.37437 0.85670
vn  0.00000 0.37437 0.92728
vn  0.35486 0.37437 0.85670
vn  0.65569 0.37437 0.65569
vn  0.85670 0.37437 0.35485
vn  1.19948 0.80147 0.23859
vn  0.85670 0.37437 -0.35486
vn  0.65569 0.37437 -0.65569
vn  0.35485 0.37437 -0.85670
vn  -0.00000 0.58697 -2.95092
vn  -1.12927 0.58697 -2.72629
vn  -2.08662 0.58697 -2.08662
vn  -2.72629 0.58697 -1.12927
vn  -1.47546 0.29349 -0.29349
vn  -2.72629 0.58697 1.12927
vn  -2.08662 0.58697 2.08662
vn  -1.12927 0.58697 2.72629
vn  0.00000 0.58697 2.95092
vn  1.12927 0.58697 2.72629
vn  2.08662 0.58697 2.08662
vn  2.72629 0.58697 1.12927
vn  1.47546 0.29349 0.29349
vn  2.72629 0.58697 -1.12927
vn  2.08662 0.58697 -2.08662
vn  1.12927 0.58697 -2.72629
vn  -0.00000 -0.37437 -0.92728
vn  -0.35485 -0.37437 -0.85670
vn  -0.65569 -0.37437 -0.65569
vn  -0.85670 -0.37437 -0.35485
vn  -1.54875 -0.30807 -0.30807
vn  -0.85670 -0.37437 0.35486
vn  -0.65569 -0.37437 0.65569
vn  -0.35485 -0.37437 0.85670
vn  0.00000 -0.37437 0.92728
vn  0.35486 -0.37437 0.85670
vn  0.65569 -0.37437 0.65569
vn  0.85670 -0.37437 0.35485
vn  1.54875 -0.30807 0.30807
vn  0.85670 -0.37437 -0.35486
vn  0.65569 -0.37437 -0.65569
vn  0.35485 -0.37437 -0.85670
vn  -0.00000 -0.69516 -0.71886
vn  -0.27510 -0.69516 -0.66414
vn  -0.50831 -0.69516 -0.50831
vn  -0.66414 -0.69516 -0.27510
vn  -1.37765 -0.92052 -0.27403
vn  -0.66414 -0.69516 0.27510
vn  -0.50831 -0.69516 0.50831
vn  -0.27510 -0.69516 0.66414
vn  0.00000 -0.69516 0.71886
vn  0.27510 -0.69516 0.66414
vn  0.50831 -0.69516 0.50831
vn  0.66414 -0.69516 0.27509
vn  1.37765 -0.92052 0.27403
vn  0.66414 -0.69516 -0.27510
vn  0.50831 -0.69516 -0.50831
vn  0.27510 -0.69516 -0.66414
vn  -0.00000 -0.91516 -0.40309
vn  -0.15426 -0.91516 -0.37241
vn  -0.28503 -0.91516 -0.28503
vn  -0.37241 -0.91516 -0.15426
vn  -0.95738 -1.43282 -0.19043
vn  -0.37241 -0.91516 0.15426
vn  -0.28503 -0.91516 0.28503
vn  -0.15426 -0.91516 0.37241
vn  0.00000 -0.91516 0.40309
vn  0.15426 -0.91516 0.37241
vn  0.28503 -0.91516 0.28503
vn  0.37241 -0.91516 0.15426
vn  0.95738 -1.43282 0.19043
vn  0.37241 -0.91516 -0.15426
vn  0.28503 -0.91516 -0.28503
vn  0.15426 -0.91516 -0.37241
vn  -0.19615 -1.50950 -0.19615
# 114 vertex normals

g Sphere01
usemtl 01_-_Default
s 1
f 1/1/1 2/18/2 3/19/3
f 1/2/1 3/19/3 4/20/4
f 1/3/1 4/20/4 5/21/5
f 1/4/1 5/21/5 6/22/6
s 8
f 1/5/1 6/22/6 7/23/7
f 1/6/1 7/23/7 8/24/8
f 1/7/1 8/24/8 9/25/9
f 1/8/1 9/25/9 10/26/10
f 1/9/1 10/26/10 11/27/11
f 1/10/1 11/27/11 12/28/12
f 1/11/1 12/28/12 13/29/13
f 1/12/1 13/29/13 14/30/14
s 1
f 1/13/1 14/30/14 15/31/15
f 1/14/1 15/31/15 16/32/16
f 1/15/1 16/32/16 17/33/17
f 1/16/1 17/33/17 2/34/2
f 2/18/2 18/35/18 19/36/19
f 2/18/2 19/36/19 3/19/3
f 3/19/3 19/36/19 20/37/20
f 3/19/3 20/37/20 4/20/4
f 4/20/4 20/37/20 21/38/21
f 4/20/4 21/38/21 5/21/5
f 5/21/5 21/38/21 22/39/22
f 5/21/5 22/39/22 6/22/6
s 8
f 6/22/6 22/39/22 23/40/23
f 6/22/6 23/40/23 7/23/7
f 7/23/7 23/40/23 24/41/24
f 7/23/7 24/41/24 8/24/8
f 8/24/8 24/41/24 25/42/25
f 8/24/8 25/42/25 9/25/9
f 9/25/9 25/42/25 26/43/26
f 9/25/9 26/43/26 10/26/10
f 10/26/10 26/43/26 27/44/27
f 10/26/10 27/44/27 11/27/11
f 11/27/11 27/44/27 28/45/28
f 11/27/11 28/45/28 12/28/12
f 12/28/12 28/45/28 29/46/29
f 12/28/12 29/46/29 13/29/13
f 13/29/13 29/46/29 30/47/30
f 13/29/13 30/47/30 14/30/14
s 1
f 14/30/14 30/47/30 31/48/31
f 14/30/14 31/48/31 15/31/15
f 15/31/15 31/48/31 32/49/32
f 15/31/15 32/49/32 16/32/16
f 16/32/16 32/49/32 33/50/33
f 16/32/16 33/50/33 17/33/17
f 17/33/17 33/50/33 18/51/18
f 17/33/17 18/51/18 2/34/2
f 18/35/18 34/52/34 35/53/35
f 18/35/18 35/53/35 19/36/19
f 19/36/19 35/53/35 36/54/36
f 19/36/19 36/54/36 20/37/20
f 20/37/20 36/54/36 37/55/37
f 20/37/20 37/55/37 21/38/21
f 21/38/21 37/55/37 38/56/38
f 21/38/21 38/56/38 22/39/22
s 8
f 22/39/22 38/56/38 39/57/39
f 22/39/22 39/57/39 23/40/23
f 23/40/23 39/57/39 40/58/40
f 23/40/23 40/58/40 24/41/24
f 24/41/24 40/58/40 41/59/41
f 24/41/24 41/59/41 25/42/25
f 25/42/25 41/59/41 42/60/42
f 25/42/25 42/60/42 26/43/26
f 26/43/26 42/60/42 43/61/43
f 26/43/26 43/61/43 27/44/27
f 27/44/27 43/61/43 44/62/44
f 27/44/27 44/62/44 28/45/28
f 28/45/28 44/62/44 45/63/45
f 28/45/28 45/63/45 29/46/29
f 29/46/29 45/63/45 46/64/46
f 29/46/29 46/64/46 30/47/30
s 1
f 30/47/30 46/64/46 47/65/47
f 30/47/30 47/65/47 31/48/31
f 31/48/31 47/65/47 48/66/48
f 31/48/31 48/66/48 32/49/32
f 32/49/32 48/66/48 49/67/49
f 32/49/32 49/67/49 33/50/33
f 33/50/33 49/67/49 34/68/34
f 33/50/33 34/68/34 18/51/18
f 34/52/34 50/69/50 51/70/51
f 34/52/34 51/70/51 35/53/35
f 35/53/35 51/70/51 52/71/52
f 35/53/35 52/71/52 36/54/36
f 36/54/36 52/71/52 53/72/53
f 36/54/36 53/72/53 37/55/37
f 37/55/37 53/72/53 54/73/54
f 37/55/37 54/73/54 38/56/38
s 8
f 38/56/38 54/73/54 55/74/55
f 38/56/38 55/74/55 39/57/39
f 39/57/39 55/74/55 56/75/56
f 39/57/39 56/75/56 40/58/40
f 40/58/40 56/75/56 57/76/57
f 40/58/40 57/76/57 41/59/41
f 41/59/41 57/76/57 58/77/58
f 41/59/41 58/77/58 42/60/42
f 42/60/42 58/77/58 59/78/59
f 42/60/42 59/78/59 43/61/43
f 43/61/43 59/78/59 60/79/60
f 43/61/43 60/79/60 44/62/44
f 44/62/44 60/79/60 61/80/61
f 44/62/44 61/80/61 45/63/45
f 45/63/45 61/80/61 62/81/62
f 45/63/45 62/81/62 46/64/46
s 1
f 46/64/46 62/81/62 63/82/63
f 46/64/46 63/82/63 47/65/47
f 47/65/47 63/82/63 64/83/64
f 47/65/47 64/83/64 48/66/48
f 48/66/48 64/83/64 65/84/65
f 48/66/48 65/84/65 49/67/49
f 49/67/49 65/84/65 50/85/50
f 49/67/49 50/85/50 34/68/34
s 4
f 50/69/50 66/86/66 67/87/67
f 50/69/50 67/87/67 51/70/51
f 51/70/51 67/87/67 68/88/68
f 51/70/51 68/88/68 52/71/52
f 52/71/52 68/88/68 69/89/69
f 52/71/52 69/89/69 53/72/53
f 53/72/53 69/89/69 70/90/70
f 53/72/53 70/90/70 54/73/54
s 2
f 54/73/54 70/90/70 71/91/71
f 54/73/54 71/91/71 55/74/55
f 55/74/55 71/91/71 72/92/72
f 55/74/55 72/92/72 56/75/56
f 56/75/56 72/92/72 73/93/73
f 56/75/56 73/93/73 57/76/57
f 57/76/57 73/93/73 74/94/74
f 57/76/57 74/94/74 58/77/58
f 58/77/58 74/94/74 75/95/75
f 58/77/58 75/95/75 59/78/59
f 59/78/59 75/95/75 76/96/76
f 59/78/59 76/96/76 60/79/60
f 60/79/60 76/96/76 77/97/77
f 60/79/60 77/97/77 61/80/61
f 61/80/61 77/97/77 78/98/78
f 61/80/61 78/98/78 62/81/62
s 4
f 62/81/62 78/98/78 79/99/79
f 62/81/62 79/99/79 63/82/63
f 63/82/63 79/99/79 80/100/80
f 63/82/63 80/100/80 64/83/64
f 64/83/64 80/100/80 81/101/81
f 64/83/64 81/101/81 65/84/65
f 65/84/65 81/101/81 66/102/66
f 65/84/65 66/102/66 50/85/50
f 66/86/66 82/103/82 83/104/83
f 66/86/66 83/104/83 67/87/67
f 67/87/67 83/104/83 84/105/84
f 67/87/67 84/105/84 68/88/68
f 68/88/68 84/105/84 85/106/85
f 68/88/68 85/106/85 69/89/69
f 69/89/69 85/106/85 86/107/86
f 69/89/69 86/107/86 70/90/70
s 2
f 70/90/70 86/107/86 87/108/87
f 70/90/70 87/108/87 71/91/71
f 71/91/71 87/108/87 88/109/88
f 71/91/71 88/109/88 72/92/72
f 72/92/72 88/109/88 89/110/89
f 72/92/72 89/110/89 73/93/73
f 73/93/73 89/110/89 90/111/90
f 73/93/73 90/111/90 74/94/74
f 74/94/74 90/111/90 91/112/91
f 74/94/74 91/112/91 75/95/75
f 75/95/75 91/112/91 92/113/92
f 75/95/75 92/113/92 76/96/76
f 76/96/76 92/113/92 93/114/93
f 76/96/76 93/114/93 77/97/77
f 77/97/77 93/114/93 94/115/94
f 77/97/77 94/115/94 78/98/78
s 4
f 78/98/78 94/115/94 95/116/95
f 78/98/78 95/116/95 79/99/79
f 79/99/79 95/116/95 96/117/96
f 79/99/79 96/117/96 80/100/80
f 80/100/80 96/117/96 97/118/97
f 80/100/80 97/118/97 81/101/81
f 81/101/81 97/118/97 82/119/82
f 81/101/81 82/119/82 66/102/66
f 82/103/82 98/120/98 99/121/99
f 82/103/82 99/121/99 83/104/83
f 83/104/83 99/121/99 100/122/100
f 83/104/83 100/122/100 84/105/84
f 84/105/84 100/122/100 101/123/101
f 84/105/84 101/123/101 85/106/85
f 85/106/85 101/123/101 102/124/102
f 85/106/85 102/124/102 86/107/86
s 2
f 86/107/86 102/124/102 103/125/103
f 86/107/86 103/125/103 87/108/87
f 87/108/87 103/125/103 104/126/104
f 87/108/87 104/126/104 88/109/88
f 88/109/88 104/126/104 105/127/105
f 88/109/88 105/127/105 89/110/89
f 89/110/89 105/127/105 106/128/106
f 89/110/89 106/128/106 90/111/90
f 90/111/90 106/128/106 107/129/107
f 90/111/90 107/129/107 91/112/91
f 91/112/91 107/129/107 108/130/108
f 91/112/91 108/130/108 92/113/92
f 92/113/92 108/130/108 109/131/109
f 92/113/92 109/131/109 93/114/93
f 93/114/93 109/131/109 110/132/110
f 93/114/93 110/132/110 94/115/94
s 4
f 94/115/94 110/132/110 111/133/111
f 94/115/94 111/133/111 95/116/95
f 95/116/95 111/133/111 112/134/112
f 95/116/95 112/134/112 96/117/96
f 96/117/96 112/134/112 113/135/113
f 96/117/96 113/135/113 97/118/97
f 97/118/97 113/135/113 98/136/98
f 97/118/97 98/136/98 82/119/82
f 114/137/114 99/121/99 98/120/98
f 114/138/114 100/122/100 99/121/99
f 114/139/114 101/123/101 100/122/100
f 114/140/114 102/124/102 101/123/101
s 2
f 114/141/114 103/125/103 102/124/102
f 114/142/114 104/126/104 103/125/103
f 114/143/114 105/127/105 104/126/104
f 114/144/114 106/128/106 105/127/105
f 114/145/114 107/129/107 106/128/106
f 114/146/114 108/130/108 107/129/107
f 114/147/114 109/131/109 108/130/108
f 114/148/114 110/132/110 109/131/109
s 4
f 114/149/114 111/133/111 110/132/110
f 114/150/114 112/134/112 111/133/111
f 114/151/114 113/135/113 112/134/112
f 114/152/114 98/136/98 113/135/113
# 224 faces

g

Posted: Wed Jul 16, 2008 6:12 pm
by JensAyton
Strange, the linked version of the script works properly here. The FACES section of the DAT looks like:

Code: Select all

FACES
128,127,127,	0.03878,0.98005,-0.19494,	3,	0,1,2
128,127,127,	0.11043,0.98005,-0.16527,	3,	0,2,3
128,127,127,	0.16527,0.98005,-0.11043,	3,	0,3,4
128,127,127,	0.19494,0.98005,-0.03878,	3,	0,4,5
129,127,127,	0.19494,0.98005,0.03878,	3,	0,5,6
129,127,127,	0.16527,0.98005,0.11043,	3,	0,6,7
129,127,127,	0.11043,0.98005,0.16527,	3,	0,7,8
129,127,127,	0.03878,0.98005,0.19494,	3,	0,8,9
129,127,127,	-0.03878,0.98005,0.19494,	3,	0,9,10
129,127,127,	-0.11043,0.98005,0.16527,	3,	0,10,11
129,127,127,	-0.16527,0.98005,0.11043,	3,	0,11,12
129,127,127,	-0.19494,0.98005,0.03878,	3,	0,12,13
130,127,127,	-0.19494,0.98005,-0.03878,	3,	0,13,14
130,127,127,	-0.16527,0.98005,-0.11043,	3,	0,14,15
130,127,127,	-0.11043,0.98005,-0.16527,	3,	0,15,16
130,127,127,	-0.03878,0.98005,-0.19494,	3,	0,16,1
130,127,127,	0.10984,0.82644,-0.55221,	3,	1,17,18
130,127,127,	0.10984,0.82644,-0.55221,	3,	1,18,2
130,127,127,	0.31280,0.82644,-0.46814,	3,	2,18,19
130,127,127,	0.31280,0.82644,-0.46814,	3,	2,19,3
130,127,127,	0.46814,0.82644,-0.31280,	3,	3,19,20
130,127,127,	0.46814,0.82644,-0.31280,	3,	3,20,4
130,127,127,	0.55221,0.82644,-0.10984,	3,	4,20,21
130,127,127,	0.55221,0.82644,-0.10984,	3,	4,21,5
131,127,127,	0.55221,0.82644,0.10984,	3,	5,21,22
131,127,127,	0.55221,0.82644,0.10984,	3,	5,22,6
131,127,127,	0.46814,0.82644,0.31280,	3,	6,22,23
131,127,127,	0.46814,0.82644,0.31280,	3,	6,23,7
131,127,127,	0.31280,0.82644,0.46814,	3,	7,23,24
…

Posted: Wed Jul 16, 2008 6:25 pm
by Davidtq
Ahruman wrote:
Davidtq wrote:
So to get more "rounded" objects I need to increase the "sections" and "slices" when creating the shapes? which will increase poly count and have some impact on performance?
Yes. You can’t have more rounded objects without increasing polygon count.
Ive now realised that the poly count barrier isnt a performance one its the oolite vertices count limit :( ah well it doesnt look too bad as it is.

Posted: Wed Jul 16, 2008 9:56 pm
by Frame
Ahruman wrote:
Strange, the linked version of the script works properly here. The FACES section of the DAT looks like:

Code: Select all

FACES
128,127,127,	0.03878,0.98005,-0.19494,	3,	0,1,2
128,127,127,	0.11043,0.98005,-0.16527,	3,	0,2,3
128,127,127,	0.16527,0.98005,-0.11043,	3,	0,3,4
128,127,127,	0.19494,0.98005,-0.03878,	3,	0,4,5
129,127,127,	0.19494,0.98005,0.03878,	3,	0,5,6
129,127,127,	0.16527,0.98005,0.11043,	3,	0,6,7
129,127,127,	0.11043,0.98005,0.16527,	3,	0,7,8
129,127,127,	0.03878,0.98005,0.19494,	3,	0,8,9
129,127,127,	-0.03878,0.98005,0.19494,	3,	0,9,10
129,127,127,	-0.11043,0.98005,0.16527,	3,	0,10,11
129,127,127,	-0.16527,0.98005,0.11043,	3,	0,11,12
129,127,127,	-0.19494,0.98005,0.03878,	3,	0,12,13
130,127,127,	-0.19494,0.98005,-0.03878,	3,	0,13,14
130,127,127,	-0.16527,0.98005,-0.11043,	3,	0,14,15
130,127,127,	-0.11043,0.98005,-0.16527,	3,	0,15,16
130,127,127,	-0.03878,0.98005,-0.19494,	3,	0,16,1
130,127,127,	0.10984,0.82644,-0.55221,	3,	1,17,18
130,127,127,	0.10984,0.82644,-0.55221,	3,	1,18,2
130,127,127,	0.31280,0.82644,-0.46814,	3,	2,18,19
130,127,127,	0.31280,0.82644,-0.46814,	3,	2,19,3
130,127,127,	0.46814,0.82644,-0.31280,	3,	3,19,20
130,127,127,	0.46814,0.82644,-0.31280,	3,	3,20,4
130,127,127,	0.55221,0.82644,-0.10984,	3,	4,20,21
130,127,127,	0.55221,0.82644,-0.10984,	3,	4,21,5
131,127,127,	0.55221,0.82644,0.10984,	3,	5,21,22
131,127,127,	0.55221,0.82644,0.10984,	3,	5,22,6
131,127,127,	0.46814,0.82644,0.31280,	3,	6,22,23
131,127,127,	0.46814,0.82644,0.31280,	3,	6,23,7
131,127,127,	0.31280,0.82644,0.46814,	3,	7,23,24
…
hmm, i´m beginning to suspect something is odd on my system with files not being updated and all..

since i found the culprit to be Ultraedit locking the file, where as it usually do not lock the file, but just updates after a notify, me about it...

I deleted the old dat file, and it worked... though i admit i gave it only a 10 min look before posting.

And today i then learned something new... smoothgroups works.., that is going to make my modeling somewhat easier.

now to test how well smoothing works ;-).. with bf1942 limits in mind.. uvs had to be connected for this to work... not that i expect that in oolite..

Thanks for the heads up..

Posted: Wed Jul 16, 2008 10:10 pm
by JensAyton
Frame wrote:
now to test how well smoothing works ;-).. with bf1942 limits in mind.. uvs had to be connected for this to work... not that i expect that in oolite..
Since Oolite stores texture co-ordinates on a per-face basis, this should not be an issue.

Posted: Wed Jul 16, 2008 10:45 pm
by Frame
Ahruman wrote:
Frame wrote:
now to test how well smoothing works ;-).. with bf1942 limits in mind.. uvs had to be connected for this to work... not that i expect that in oolite..
Since Oolite stores texture co-ordinates on a per-face basis, this should not be an issue.
i´m a tad puzzled though, i seem to get , from what i can read in the dat file Smooth groups from

128 to 145

If i read that correctly thats 18 smoothgroups, from originally 4

I then look at the smoothing sections of the obj file... and count

18 sections...

Is this intended behaviour.. i should have smoothgroup 128 to 131, since in the obj file its "s 1" to "s 8", the number scheme seems to be binary "s 1, s 2, s 4, s 8" and so on..

EDIT here is the python section of obj2dattex.py in question the current one

starting at line 125

Code: Select all

if (tokens[0] == 's'):
				# we check the group number if it's zero this is a non-smoothed group
				group_token = int(tokens[1])
				if (group_token > 0):
					smoothing_group = smoothing_group + 1
I think that is wrong way to approach it.. but i´m going to counter check my sphere in Oolite.. just to be sure..