Important information: this site is currently scheduled to go offline indefinitely by end of the year.

3D model reversing compilation

Post questions about game models here, or help out others!
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: 3D model reversing compilation

Post by shakotay2 »

blackracer wrote:I decided to explore the noesis but I did not get to do one-stop solution for all model files ((
Seems you didn't even get the solution for loading one img file.
in def noepyCheckType(data):
it's
if bs.readBytes(4).decode,
so (4) not (8)

why do you try to get VCount from address 0x0004?
bs.seek(0x4, NOESEEK_ABS)
VBytes = 36
VCount = bs.readUInt() // VBytes

Your reading the VBuf then IBuf, though IBuf comes first in wheel_rays_te37.img,
your reading short instead of float, you're reading triangles, though you used Strip with hex2obj,
guess you don't know what you're doing with that script, do you?

There's a basic tutorial from chrrox here: viewtopic.php?f=29&t=7760
Here's your modified script that does import the wheel only, counts set manually:

Code: Select all

from inc_noesis import *
import noesis
import rapi

def registerNoesisTypes():
    handle = noesis.register("TestScriptGame", ".img")
    noesis.setHandlerTypeCheck(handle, noepyCheckType)
    noesis.setHandlerLoadModel(handle, noepyLoadModel)
    #noesis.logPopup()
    return 1

NOEPY_HEADER = "IMGE"
   
def noepyCheckType(data):
   bs = NoeBitStream(data)
   if len(data) < 8:
      return 0
   if bs.readBytes(4).decode("ASCII").rstrip("\0") != NOEPY_HEADER:
      return 0
   return 1  

def noepyLoadModel(data, mdlList):
    ctx = rapi.rpgCreateContext()
    bs = NoeBitStream(data)
    fileName = rapi.getLocalFileName(rapi.getInputName()).rstrip(".img")
    rapi.rpgSetName(fileName)
    print(fileName)
    bs.seek(0xFE3, NOESEEK_ABS)

    #FCount = bs.readUInt() // 2
    FCount = 513
    IBuf = bs.readBytes(FCount * 2) 

    bs.seek(0x20C0, NOESEEK_ABS)
    VBytes = 36            
    #VCount = bs.readUInt() // VBytes
    VCount = 200
    VBuf = bs.readBytes(VCount * VBytes)
    #skip = bs.readBytes(8)

    rapi.rpgBindPositionBufferOfs(VBuf, noesis.RPGEODATA_FLOAT, VBytes, 0)   
    rapi.rpgBindUV1BufferOfs(VBuf, noesis.RPGEODATA_SHORT, VBytes, 28)   
    rapi.rpgCommitTriangles(IBuf, noesis.RPGEODATA_USHORT, FCount, noesis.RPGEO_TRIANGLE_STRIP, 1) #SHORT for word indices
    mdl = rapi.rpgConstructModel()                                                          
    mdlList.append(mdl)
    rapi.rpgClearBufferBinds()
    return 1
Here I made a template, you can help me fix it to read model with names of the textures.
Getting textures is the next step. Try to get the models first.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
blackracer
advanced
Posts: 51
Joined: Sat Jun 27, 2015 1:20 pm
Has thanked: 30 times
Been thanked: 49 times

Re: 3D model reversing compilation

Post by blackracer »

Yes, I really do not quite understand, thank you very much for the modification of the script in the first place I need to understand the structure of hex.
Next step I will try to read all meshes in this format.
I have been studying this tutorial :)
zaphiri
ultra-n00b
Posts: 3
Joined: Sat Sep 22, 2018 2:10 am

Re: 3D model reversing compilation

Post by zaphiri »

Would you convert the ''obj ou 3d'' in ''SKI'' ?
usabdt
advanced
Posts: 47
Joined: Thu Sep 20, 2018 9:28 pm
Has thanked: 10 times
Been thanked: 5 times

Re: 3D model reversing compilation

Post by usabdt »

finale00 wrote:3D model formats index
3D model guide

Now something is coming together.
finale00 wrote:We should probably add something similar to the definitive guide to exploring file formats, for 3D models.
The layout would be similar, in particular listing some common patterns that are usually observed. It would then diverge into different "types" of formats, as I would imagine models for console games would be much different from models for PC games for various reasons.

Though, I'm not sure if people actually check the wiki :|
HI, finale00
Do you know what software does this? viewtopic.php?f=16&t=8347 I need to get the file in. dat I do not know english. I tried reversing but it was too hard. If you know let me know. Thanks you
andy97
beginner
Posts: 36
Joined: Sun Apr 28, 2019 1:15 pm
Has thanked: 5 times
Been thanked: 23 times

Re: 3D model reversing compilation

Post by andy97 »

Hi, I'm a newbie in parsing 3d model. I'm learning to write my own Noesis script. I have a question:

Based on my knowledge in using shakotay's hex2obj, I know that we have 3 ways to get the vertex count:
- It is defined in the data
- Divide vertex block length by 1-vertex stride length
- Max face index

Unfortunately, the files that I'm working on don't have defined vertex count inside itself but in another file. As far as I know, Noesis scripts must have VCount and FCount. Since I'm a newbie, I just want to work with a single format only. Is there any solution for this case? Thank you :D :D

P/s: Also, regarding to the files that have vertex count defined in them, how can we recognize "vertex count" exactly?
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: 3D model reversing compilation

Post by shakotay2 »

andy97 wrote: Sun Apr 28, 2019 2:06 pmI just want to work with a single format only. Is there any solution for this case? Thank you :D :D
Try to use rapi.loadPairedFile()
.
such like this (untested!):

Code: Select all

    xData = rapi.loadPairedFile("file_with_params", ".dat")
    data = NoeBitStream(xData)
    data.seek(0x08, NOESEEK_REL)# replace 0x08 by real offset
    vCount = data.readInt()  # read vertex count
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
3drussiangrabber
beginner
Posts: 30
Joined: Sun Jan 26, 2020 5:12 pm
Has thanked: 4 times
Been thanked: 4 times

Re: 3D model reversing compilation

Post by 3drussiangrabber »

Can someone please take a look on this file package (three bin files)?
Sourse: monsieurnossDOTcom

Thank's!!!1

https://dropmefiles.com/kb55G
User avatar
3drussiangrabber
beginner
Posts: 30
Joined: Sun Jan 26, 2020 5:12 pm
Has thanked: 4 times
Been thanked: 4 times

Re: 3D model reversing compilation

Post by 3drussiangrabber »

{

"metadata":
{
"sourceFile": "",
"generatedBy": "Blender 2.65 Exporter",
"formatVersion": 3.1,
"vertices": 6857,
"normals": 6857,
"colors": 0,
"uvs": 0,
"triangles": 7102,
"materials": 1
},

"materials": [
{
"DbgIndex" : 0,
"DbgName" : "02 - Default",
"colorDiffuse" : [0.0000, 0.4353, 0.0196],
"colorAmbient" : [0.0000, 0.4353, 0.0196],
"colorSpecular" : [0.9000, 0.9000, 0.9000],
"transparency" : 1.0,
"specularCoef" : 10.0,
"vertexColors" : false
}

],

"vertices": [-176.133..............................
Xentax please Help! How to get 3d model from it ???
https://dropmefiles.com/xp7T0

js JSON ?
how JSON convert to example to OBJ ????
Blender OLD plugin don't work to import JSON, only work SAVE to JSON (export)
User avatar
Beridow
ultra-n00b
Posts: 4
Joined: Mon Aug 03, 2020 11:33 am
Been thanked: 1 time

Re: 3D model reversing compilation

Post by Beridow »

What are you thinking about such technologies https://www.it-jim.com/blog/tessact-lib ... iguration/ for example, I would like trying OCR system. I think that it's live up to my expectations because it's a brilliant idea.
Jan666
veteran
Posts: 125
Joined: Wed Oct 31, 2018 6:26 pm
Has thanked: 17 times
Been thanked: 12 times

Re: 3D model reversing compilation

Post by Jan666 »

I have a question, i wanna find out the right xyz coordinates of the Objects to reconstruct a level, so anyone know where i can find it?
Ayla658
ultra-n00b
Posts: 3
Joined: Tue Sep 05, 2023 11:04 pm
Location: Pakistan
Contact:

Re: 3D model reversing compilation

Post by Ayla658 »

The guide could be divided into two sections: a general section that covers the common patterns found in 3D model files, and a section that covers specific file formats.
Post Reply