READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Does anyone interested in webgl?

Post questions about game models here, or help out others!
User avatar
zaykho
mega-veteran
mega-veteran
Posts: 212
Joined: Fri Dec 03, 2010 1:20 pm
Location: France
Has thanked: 144 times
Been thanked: 33 times

Re: Does anyone interested in webgl?

Post by zaykho » Fri May 04, 2012 9:25 am

I tried to dump directly from the web viewer in firefox, but the browser crashes when 3dvia starts ripping .
Have you tried another web browser ? like Chrome ? I know that webkit and Geko doesn't use the same render processing method for Webgl....

If even with another Web Browser its doesn't work, let's try this :

https://addons.mozilla.org/fr/firefox/addon/scrapbook/

Its a very great addon for FF, IT CAN CAPTURE EVERYTHING !!! but can take some time and place (be sure to have at less 4go free on HDD)

Vashey
advanced
Posts: 41
Joined: Tue Mar 15, 2011 2:47 pm
Has thanked: 9 times

Re: Does anyone interested in webgl?

Post by Vashey » Sun Jun 10, 2012 12:33 pm

Hi, I'm bumping this thread because I'm actualy trying to download 3D models from that exact site.
So there are some things I don't understand.

First how do you save the webgl file from the site? Because when I try to import it in noesis it doesn't allow me.
And I can't seem to find anything in the ressource tab.

What should I search for in google cache view?

Vashey
advanced
Posts: 41
Joined: Tue Mar 15, 2011 2:47 pm
Has thanked: 9 times

Re: Does anyone interested in webgl?

Post by Vashey » Sun Jun 10, 2012 3:50 pm

Ok I've found the textures with a webgl device, but that's realy strange, for some reason the texture links wouldn't save in the cache.
Do you happen to know why?

Also the 3D models are saved elsewhere, there is absolutely no way to capture them like if it was a normal 3D renderer.


edit : sorry, I didn't read all the details.
It seems the script doesn't import everything, and that noone gives a crap about it.

So there is absolutely no way to rip the models.

Motumoyo
ultra-n00b
Posts: 3
Joined: Tue Jun 12, 2012 2:47 am
Location: New York
Contact:

Re: Does anyone interested in webgl?

Post by Motumoyo » Tue Jun 12, 2012 5:50 am

I can not figure out what I put the index of the code fragment mode.
Charming Ladies black leather Platform Shoes and that's really beautiful. Choose the high quality Genuine leather wedges sandals will be fashion.

Ares722
veteran
Posts: 154
Joined: Thu Jul 15, 2010 2:15 pm
Has thanked: 24 times
Been thanked: 9 times

Re: Does anyone interested in webgl?

Post by Ares722 » Thu Jun 14, 2012 11:20 am

zaykho wrote:
I tried to dump directly from the web viewer in firefox, but the browser crashes when 3dvia starts ripping .
Have you tried another web browser ? like Chrome ? I know that webkit and Geko doesn't use the same render processing method for Webgl....

If even with another Web Browser its doesn't work, let's try this :

https://addons.mozilla.org/fr/firefox/addon/scrapbook/

Its a very great addon for FF, IT CAN CAPTURE EVERYTHING !!! but can take some time and place (be sure to have at less 4go free on HDD)

I know it, its a great addon for firefox but i think it's useless in this case because even if u ripp all that site offline, then u need firefox to see the models. I tried with all browser that support webgl format but i didn't managed to ripp anything. Obviulsy the textures are quite easy to ripp, but nothing else at the moment.

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 294 times

Re: Does anyone interested in webgl?

Post by finale00 » Thu Jun 14, 2012 11:26 am

Vashey wrote:Ok I've found the textures with a webgl device, but that's realy strange, for some reason the texture links wouldn't save in the cache.
Do you happen to know why?

Also the 3D models are saved elsewhere, there is absolutely no way to capture them like if it was a normal 3D renderer.


edit : sorry, I didn't read all the details.
It seems the script doesn't import everything, and that noone gives a crap about it.

So there is absolutely no way to rip the models.
The 3D models are stored in a text file that contains a huge json-like array that defines all of the vertices, normals, UV's, weights and bones (if animated), materials, etc for a single model.

I've already given links to the source file containing the model data, unless they changed how the structure of the website.

http://www.3dcg-arts.net/api/model/get/three_format/132

I don't see much point in ripping them.

User avatar
zaykho
mega-veteran
mega-veteran
Posts: 212
Joined: Fri Dec 03, 2010 1:20 pm
Location: France
Has thanked: 144 times
Been thanked: 33 times

Re: Does anyone interested in webgl?

Post by zaykho » Wed Jun 20, 2012 8:43 pm

I know it, its a great addon for firefox but i think it's useless in this case because even if u ripp all that site offline, then u need firefox to see the models. I tried with all browser that support webgl format but i didn't managed to ripp anything. Obviulsy the textures are quite easy to ripp, but nothing else at the moment.
No, No, No, you don't see the point.

The goal is:

1 - rip everything from the source into a folder

2 - find the folder, and look what is the format used, .txt ? .json ? etc....

3 - After find the file, open him with a notepad or bloc-note, and see the header, what is the detailed format used ? json-2.15 ?

4 - Then search a converter, like this:

http://www.softpedia.com/get/Others/Mis ... rter.shtml

Vashey
advanced
Posts: 41
Joined: Tue Mar 15, 2011 2:47 pm
Has thanked: 9 times

Re: Does anyone interested in webgl?

Post by Vashey » Mon Nov 05, 2012 2:52 am

The 3D models are stored in a text file that contains a huge json-like array that defines all of the vertices, normals, UV's, weights and bones (if animated), materials, etc for a single model.

I've already given links to the source file containing the model data, unless they changed how the structure of the website.

http://www.3dcg-arts.net/api/model/get/three_format/132

I don't see much point in ripping them.



I have my reasons to rip some of them.
I understand what you mean, but the page to the source code concerns only one model (that I don't care about) and this source code, what am I supposed to do with?
Because I already tried to import the .webgl on noesis, it doesn't work, makes noesis crash (I obviously used your script).

User avatar
Tosyk
double-veteran
double-veteran
Posts: 934
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 225 times
Been thanked: 109 times
Contact:

Re: Does anyone interested in webgl?

Post by Tosyk » Mon Jan 14, 2013 5:41 pm

viewtopic.php?f=16&t=9978
here what i found, hope finale could look into this
all model are presented in a three.js format

model sample
Thank you for all you do here
my blog | my forum

figuresculptor
beginner
Posts: 33
Joined: Thu Jan 06, 2011 9:08 pm
Been thanked: 4 times

Re: Does anyone interested in webgl?

Post by figuresculptor » Wed Apr 02, 2014 4:44 pm

I hate to resurrect an old thread, but I hacked out a quick Ruby script for converting the 3dcg-arts models into a standard .obj file.

It's not perfect, but seems to work pretty well, at least for the older format files. You have to manually add the correct images to the materials, but the UVs and material entries should get created correctly. I haven't found how to find the image name to link to each material yet, but I assign different random colors to each material to make it easier to see which part of the model uses which material.

Use of the script is a little convoluted. From the developer console, save the javascript file with all the vertex data for the model (usually the filename is the model number), then run this script on that file. It's a Ruby script, so call it from the command line, passing the filepath to the saved javascript file as an argument. It will batch multiple if you pass multiple file paths in at once.

EDIT: I should've used a larger test sample before posting. This doesn't work for all files, so caveat emptor. I'll post a fixed version when I figure out why some files work and some don't.

Code: Select all

#! /usr/bin/env ruby
require 'rubygems'
require 'json'

def write_verts(vertices, file)
	puts "Writing Vertices…"

	vertex_counter = 0
	vertices.each do |one_vertex|
		if vertex_counter % 3 == 0
			file.write("v ")
		end
		
		file.write("#{one_vertex.to_s} ")
		vertex_counter = vertex_counter + 1
		
		if vertex_counter %3 == 0
			file.write("\n")
		end
	end
	puts "\tVertices written: #{vertices.length / 3}"
end

def write_uvs(uvs, file)
	puts "Writing UVs…"
	vertex_counter = 0
	uvs.each do |one_uv|
		if vertex_counter % 2 == 0
			file.write("vt ")
		end
		file.write("#{one_uv.to_s} ")
		vertex_counter = vertex_counter + 1
		if vertex_counter % 2 == 0
			file.write("\n")
		end
	end
	puts "\tUVs written:#{uvs.length / 2}\n"
end
def write_normals(normals, file)
	puts "Writing Normals…"

	vertex_counter = 0
	normals.each do |one_normal|
		if vertex_counter % 3 == 0
			file.write("vn ")
		end
		
		file.write("#{one_normal.to_s} ")
		vertex_counter = vertex_counter + 1
		
		if vertex_counter %3 == 0
			file.write("\n")
		end
	end
	puts "\tNormals written:#{normals.length / 3}\n"
end

def write_triangle(faces, offset, file)
	x = faces[offset]
	y = faces[offset+1]
	z = faces[offset+2]

	file.write("f #{x}// #{y}// #{z}//\n")
end
def write_quad(faces, offset, file)
	x = faces[offset]
	y = faces[offset+1]
	z = faces[offset+2]
	w = faces[offset+3]
	file.write("f #{x}// #{y}// #{z}// #{w}\n")
end
def write_faces(vertex, faces_string, file, materials_array)
	puts "Writing Faces…"
	
	
	faces = faces_string.scan(/(42,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+)|(43,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+)/)
	x = y = z = w = 0
	face_count = 0
	
	material_count = 1
	last_material_index = -1
	
	faces.each do |one_face|
		face_parts = one_face.compact[0].split(",")
		
		if face_parts[0] = 42
			material_index = face_parts[4]
			
			if (material_index != last_material_index)
				file.write("usemtl texture#{material_index}\n")
				materials_array.push("texture#{material_index}") unless materials_array.include?("texture#{material_index}")
				last_material_index = material_index
				
			end
			x = face_parts[1].to_i + 1
			y = face_parts[2].to_i + 1
			z = face_parts[3].to_i + 1
			xt = face_parts[5].to_i + 1
			yt = face_parts[6].to_i + 1 
			zt = face_parts[7].to_i + 1
			xn = face_parts[8].to_i + 1
			yn = face_parts[9].to_i + 1
			zn = face_parts[10].to_i + 1
			file.write("f #{x}/#{xt}/ #{y}/#{yt}/ #{z}/#{zt}/\n")
		elsif face_parts[0] = 43
			material_index = face_parts[5]
			if (material_index != last_material_index)
				file.write("usemtl texture#{material_index}\n")
				materials_array.push("texture#{material_index}") unless materials_array.include?("texture#{material_index}")
				last_material_index = material_index
				
			end
			x = face_parts[1].to_i +1
			y = face_parts[2].to_i +1
			z = face_parts[3].to_i +1
			w = face_parts[4].to_i +1
			xt = face_parts[6].to_i +1
			yt = face_parts[7].to_i +1
			zt = face_parts[8].to_i +1
			wt = face_parts[9].to_i +1
			xn = face_parts[10].to_i +1
			yn = face_parts[11].to_i +1
			zn = face_parts[12].to_i +1
			wn = face_parts[13].to_i +1
			file.write("f #{x}/#{xt}/ #{y}/#{yt}/ #{z}/#{zt}/ #{w}/#{wt}/\n")
		end
		face_count = face_count + 1
	end
	puts "\tFaces written: #{face_count.to_s}"
end

ARGV.each do|a|
	input_file_path = a
	puts "Processing file: #{a}"
	json_file = File.open(input_file_path, "r")
	json_text = json_file.read
	json_file.close

	start_token = "var m = "
	end_token = "]]};"
	data_start_index = json_text.index(start_token) + start_token.length
	data_end_index = json_text.index(end_token) + end_token.length

	json_text = json_text[data_start_index, data_end_index - data_start_index - 1]

	json_data = JSON.parse(json_text)

	vertices = json_data["vertices"][0]
	faces = json_data["faces"]
	uvs = json_data["uvs"][0][0]
	normals = json_data["normals"][0]
	materials = json_data["materials"][0]

	puts "Raw Vertices: #{vertices.length}"
	puts "Raw Faces:    #{faces.length}"
	puts "Raw UVs:      #{uvs.length}"

	mtl_filepath = "#{input_file_path}.mtl"
	mtl_localfile = mtl_filepath.split(File::SEPARATOR)[-1]
	output_file_path = "#{input_file_path}.obj"

	materials_array = []
	File.open(output_file_path, 'w') do |file|

		file.write("mtllib #{mtl_localfile}\n")
		write_verts(vertices, file)
		write_uvs(uvs, file)
		
		write_faces(vertices, faces.join(","), file, materials_array)
	end

	File.open(mtl_filepath, 'w') do |file|
		materials_array.each do |one_material|
			file.write("newmtl #{one_material}\n")
			file.write("Kd #{rand} #{rand} #{rand}\n");
			file.write("Ka 0.600 0.600 0.600\n");
			file.write("Ks 0.000 0.000 0.000\n");
			file.write("Tr 1.0\n");
			file.write("#{one_material}.png\n");
		end
	end
end

Seventyseven
ultra-n00b
Posts: 2
Joined: Thu Sep 13, 2007 10:28 am
Been thanked: 1 time

Re: Does anyone interested in webgl?

Post by Seventyseven » Sat Jun 21, 2014 1:28 pm

^ There are two more face types.

40 - triangle without the material index I assume since followed by 9 numbers

41 - quad without the material index I assume since followed by 12 numbers

Edit:

Also there can be more than one face array and I assume vertex and uvs arrays.

Seems one face array can hold about 262 144 numbers and then another list is needed.
The arrays split at the 262 144 th entry even if that is the middle of a face.
The rest of that face data is start of next array.

headgehof
beginner
Posts: 21
Joined: Sun Jun 27, 2010 3:11 pm
Has thanked: 1 time

Re: Does anyone interested in webgl?

Post by headgehof » Mon Jul 20, 2015 3:58 am

any fix for this
You do not have the required permissions to view the files attached to this post.

Post Reply