Go Back   the Magicball Network > Forums > Fan Creations > Fan Creations - General
Buy LBA1/Relentless from GOG.com Buy LBA1/Relentless from DotEmu Buy LBA2/Twinsen's Odyssey from DotEmu Buy LBA2/Twinsen's Odyssey from GOG.com Buy Little big Adventure from GOG.com or DotEmu Buy Little big Adventure 2 from DotEmu or GOG.com

Welcome to the Magicball Network.

You are currently viewing our site as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Fan Creations - General The place for the creative LBA fans.

Reply
 
Thread Tools
  #1  
Old 2018-11-10, 15:28
solarix's Avatar
solarix solarix is offline
Magic Level: Yellow Ball
 
Join Date: Sep 2018
Location: Switzerland
Posts: 11
How to: coloring/texturing LBA2 models

Hi folks,

I'm working on my own LBA1/2-Implementation (https://github.com/solarix95/lbaworld), but right at the moment: I'm stuck.

I simply don't get the coloring/texturing done for lba2 models. I try to understand lba2remake, but JS is (without typeinformation) still hard to read for me. It's difficult to follow the color/texture/uv-information from body.hqr/ress.hqr to the shader. LBA1 is easy, because I can compile, run and debug twin-e and can compare values of single variables with my own implementation.

So, xesf, adrien and all other hackers out there: how did you start with your own lba2 renderer? Is there a twin-e-like reference implementation for lba2? Does anyone have the source code of the "LBA Model Viewer" by yaz0r? The viewer supports lba2 models and looks like C++/Qt...


Thanks for any advice/hint/help!
solarix


[Edit] attached printscreen of my own modelviewer. I'm able to load normals, vertices, bones, polygones, but not the colors/textures.
Attached Thumbnails
Click image for larger version

Name:	lba2_model370.png‎
Views:	20
Size:	59.1 KB
ID:	10204  
Reply With Quote
  #2  
Old 2018-11-21, 01:23
MrQuetch's Avatar
MrQuetch MrQuetch is offline
Quetching a Mr.
 
Join Date: Apr 2011
Location: United States
Posts: 712
Hi there, Solarix.

You are doing great things with your knowledge. You look like you're getting very close to fully implementing the models. I still have yet to load in existing LBA 2 models myself. I've actually been working on a Maxscript to port fully custom models from Autodesk 3DS Max directly into the LBA2 model format. My next step is to create animated models within Unity. Remember that you need to allow the right amount of space - depending on if you want to draw a triangle or a quadrilateral. Also, the colors and material both use their own bytes. I've actually been using Yaz0r's LBA Model viewer to make sure my data works properly - I don't know of any existing source code. If It helps, I used this link to get the polygon data properly.

http://lbafileinfo.kazekr.net/index....=LBA2:3D_model

Let me know if that helps. I don't check here as often as I used to. If I may ask a question, how did you get the bones working? I cannot get the vertices' offsets properly. They're supposed to come from the origin on the bone they're attached to.
__________________
I am a Quetch. However, I am a Mr. Quetch.

Last edited by MrQuetch; 2018-11-21 at 01:31.
Reply With Quote
  #3  
Old 2018-11-22, 00:59
solarix's Avatar
solarix solarix is offline
Magic Level: Yellow Ball
 
Join Date: Sep 2018
Location: Switzerland
Posts: 11
Hi MrQuetch,
thanks for your anwser!

Quote:
Originally Posted by MrQuetch View Post
You are doing great things with your knowledge. You look like you're getting very close to fully implementing the models.
Let's see what I can do . But having an engine supporting LBA1/LBA2 and custom models (3DS, Blender..) would be fun .
The geometry of the LBA2-models looks complete to me... Just the colors/texturing still don't work. Grrr...

Quote:
Originally Posted by MrQuetch View Post
I still have yet to load in existing LBA 2 models myself. I've actually been working on a Maxscript to port fully custom models from Autodesk 3DS Max directly into the LBA2 model format. My next step is to create animated models within Unity.
That's great! Looks like we're working both on the same challenge.. Are you going to load original LBA2-Models (direct from body.hqr/ress.hqr) into unity?

Quote:
Originally Posted by MrQuetch View Post
Remember that you need to allow the right amount of space - depending on if you want to draw a triangle or a quadrilateral. Also, the colors and material both use their own bytes.
My problem is simple: I don't understand the output of my own "loadPolygon" method (similar to "loadPolygon()" of lba2remake). I mostly get "hasTex == false" and color-indexes for black and violett. Maybe there's a bug in my parser or maybe I don't understand what I get. That's why I'm looking for a debuggable lba2-model loader.

Quote:
Originally Posted by MrQuetch View Post
If I may ask a question, how did you get the bones working? I cannot get the vertices' offsets properly. They're supposed to come from the origin on the bone they're attached to.
You're right: the vertices' offsets ("translation") come from the parent(!)-bone.

Let's start at bone 0: parent bone is "-1". So you can't translate bone 0 attached vertices. Bone "1" has (e.g.) parent ID "0". So read the vertex-Index of bone 0, take that vertex from the vertex-list and that's your x/y/z-offset for Bone 1 attached vertices. All offsets are relative, not absolute. If you have a branch with bone 0 -> bone 1 -> bone 2, then the vertices of bone 2 are translated by adding the offset of bone 1 and offset of bone 0.

My implementation (LbaBody::translateVertices()) uses recursion. I start at bone 0 and commit the "current offset" to the next bone in the branch recursively. You can ignore the "rotation"-stuff. That's for animation and not needed for basic bone-translation.

Hope this helps!
solarix
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LBA1 PS Models on LBA2 PC MrQuetch LBA Modifications - General 4 2012-05-14 05:20
My LBA models Flip_One Fan Art 99 2010-11-03 10:50
Creative texturing punkflare Off topic 9 2003-01-30 14:29
My models punkflare The Relentless Movie project 6 2002-12-25 18:13
axx's 3d models Axx The Relentless Movie project 43 2002-06-24 02:59


All times are GMT +2. The time now is 09:51.




News Feed
Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2016, the Magicball Network