English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 03 June 2014, 21:34   #1
tassel
Tassel / LaBaN
 
tassel's Avatar
 
Join Date: Feb 2014
Location: Kristiansand / Norway
Posts: 42
3D import - Tools & Example source of 3D data

Hi,

A technical question. Today I work with 3D (mostly 3DS Max) and I remember it was an example of importing lightwave objects back in the days. Is there someone who has made ​ example source of importing 3ds data or a routine that reads plain text files with coordinates?

I'm thinking of making a maxscript to write text files with coordinate data so i can use it for intros/demos etc.

What tools are available on the amiga/pc to do such things today?

Last edited by tassel; 03 June 2014 at 22:14.
tassel is offline  
Old 04 June 2014, 10:35   #2
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
try posting this sort of question on pouet.net.. much better chances of getting answers to demo- and 3d-related questions there..
hooverphonique is offline  
Old 04 June 2014, 23:48   #3
Bastich
Registered User
 
Bastich's Avatar
 
Join Date: Jul 2011
Location: UK
Posts: 341
Max can output ASE files which are text readable. Other than that 3DS files are fairly simple to decode and can be in/exported.
Don't try looking into MAX files they are about as use able as Lightwave LWS files. Old format LWO files are also simple, just not the modern v5 onwards versions.
Bastich is offline  
Old 05 June 2014, 01:55   #4
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
What about FBX ascii files? Max can export those.
Thorham is offline  
Old 05 June 2014, 09:34   #5
Clarky
 
Posts: n/a
Have you had a look at http://assimp.sourceforge.net/? I've used it lot's and it's been really usefull
 
Old 05 June 2014, 11:04   #6
Bastich
Registered User
 
Bastich's Avatar
 
Join Date: Jul 2011
Location: UK
Posts: 341
Clarky - Nice link It even supports bones I may have to give this one a go again as it would be simpler than a MAX plugin or the FBX SDK for getting skinned mesh animations.
Bastich is offline  
Old 05 June 2014, 16:28   #7
tassel
Tassel / LaBaN
 
tassel's Avatar
 
Join Date: Feb 2014
Location: Kristiansand / Norway
Posts: 42
If we only want the coordinates from the object, we can use a maxscript (found in the maxscript documentation):

The snippet:
Code:
tmesh = snapshotAsMesh selection[1]
out_file = createfile ((GetDir #export)+"/testmesh.dat")
format "%,%\n" tmesh.numverts tmesh.numfaces to:out_file
for v = 1 to tmesh.numverts do
format "%," (getVert tmesh v)to:out_file
format "\n" to:out_file
for f = 1 to tmesh.numfaces do
format "%," (getFace tmesh f) to:out_file
close out_file
That is a starting point...

If we have a 3D Box in 3DS Max this is what i get:
Code:
8,12
[-2.5,-2.5,-2.5],[2.5,-2.5,-2.5],[-2.5,2.5,-2.5],[2.5,2.5,-2.5],[-2.5,-2.5,2.5],[2.5,-2.5,2.5],[-2.5,2.5,2.5],[2.5,2.5,2.5],
[1,3,4],[4,2,1],[5,6,8],[8,7,5],[1,2,6],[6,5,1],[2,4,8],[8,6,2],[4,3,7],[7,8,4],[3,1,5],[5,7,3],
Now i have to make a routine that read this data and displays/rotate the 3D data.
(This is going to be a challenge for me, because it's a long time since i have done anything in amiga asm, so i will probably need some time (1 year ) to get into this as I never moved to this area last time I tried programming asm.)
tassel is offline  
Old 05 June 2014, 16:55   #8
Bastich
Registered User
 
Bastich's Avatar
 
Join Date: Jul 2011
Location: UK
Posts: 341
Good luck
Bastich is offline  
Old 06 June 2014, 01:17   #9
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Quote:
Originally Posted by hooverphonique View Post
try posting this sort of question on pouet.net.. much better chances of getting answers to demo- and 3d-related questions there..
You sure about that?

Just export lightwave. You'll get poly and uv coords, and ccw polys. Calc normals and optionally scale to big ints. Adapt to your working vector routine.
Photon is offline  
Old 06 June 2014, 19:09   #10
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by Photon View Post
You sure about that?
well, it could also end up in a flame war/trolling/mocking or any other sort of situation
hooverphonique is offline  
Old 06 June 2014, 23:15   #11
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Well, there's that, but I guess I meant that EAB is also a source for coding tips.

Anyway the lightwave text format is well-made and pretty simple, bunch of vertices
Code:
v [x] [y] [z]
v [x] [y] [z]
...
Followed by a bunch of faces
Code:
f [vertex1] [vertex2] [vertex3]...
f [vertex1] [vertex2] [vertex3]...
...
Remember to clean up your model and I prefer Maya's export.
Photon is offline  
Old 07 June 2014, 12:30   #12
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
i've found a lightwave object converter by The Black Lotus. it's a ms-dos tool, source code included.
maybe someone can make an amiga executable or make it work on win7 / 8.1 ?

zoned: TBL-LWC.lha

e4dit: you need the dos-extender dos4gw.exe or dos32a
- use these instruction to replace dos4gw with dos32a.

in dosbox-0.74.conf set: memsize=64 and it does work ( dos32a tested ).

edit2: it's already on aminet, also a ppc version with source and smakefile
Attached Thumbnails
Click image for larger version

Name:	lwconv.png
Views:	234
Size:	7.9 KB
ID:	40225  

Last edited by emufan; 07 June 2014 at 13:23.
emufan is offline  
Old 09 June 2014, 22:00   #13
tassel
Tassel / LaBaN
 
tassel's Avatar
 
Join Date: Feb 2014
Location: Kristiansand / Norway
Posts: 42
Hi,

Thanks for the input guys

I'll do some more research around this and come back when I get time (going a little slow now that it's summer)
tassel is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
LTTF: Amiga CD32 Games ~ HFT: Old School & Import Games mobiusclimber Swapshop 3 08 December 2015 00:35
Xcopy pro & Tools with Cyclone Dongle teamhack22 request.Apps 5 14 September 2010 20:52
Xcopy pro & Tools 1993 amiga disk teamhack22 request.Apps 5 12 July 2010 23:20
Devious Tools & Amiga Emulation Nation Demiurgo request.Apps 10 01 May 2008 13:19
x-copy & tools (1993)(-) Ian request.Apps 6 23 April 2002 21:49

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


All times are GMT +2. The time now is 05:30.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09640 seconds with 14 queries