I have tried your patch but it didn't change things really. Out of curiosity I compiled the current head on a 32bit machine (also under Linux) and I get the exact same behavior (using the original 3ds2mgf.c).
So I finally tried an older binary of 3ds2mgf (Radiance 3.6a) on the same system and this one works just fine. Unfortunatly I dont have the sources anymore to see what happens if I compile them
Somehow I get a feeling it might have to do with the gcc version I am using on all these systems nowadays:
# gcc --version
gcc (GCC) 4.1.2 (Gentoo 4.1.2 p1.1)
For all older compilations I am pretty sure I was still using gcc 3.*.
Just in case that helps.
Erwin
···
-------- Original Message --------
Subject: Re: [Radiance-dev] behavior of 3ds2mgf (07-Okt-2008 18:40)
From: Gregory J. Ward <[email protected]>
To: [email protected]
Hi Erwin,
I'm pretty sure the problem is in 3ds2mgf.c:
float read_float()
{
dword data;
data = read_dword();
return *(float *)&data;
}
which assumes that "unsigned long" is 4-bytes long. This bit of code
would actually work on a BigEndian system (I think), but not on
Intel. This is not my code, so I'm not 100% confident on this fix,
but try it:
float read_float()
{
union { dword i; char c[8]; } u;
dword data;
data = read_dword();
if (sizeof(dword) == sizeof(float))
return *(float *)&data;
u.i = 1;
if (u.c[0] == 0)
return *(float *)&data; /* assume big-endian */
if (sizeof(dword) != 2*sizeof(float)) {
fputs("Unsupported word length\n", stderr);
exit(1);
}
u.i = data;
return *(float *)&u.c[4];
}
-Greg
_______________________________________________
Radiance-dev mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-dev
Hi Bernd,
thanks for the offer, I will send you the exact same file plus the commandline I used in a private mail. And of course I will report back to the list later once we have solved this issue - just in case others run into this problem too. Actually radiance-general will probably be more apropriate for the report.
Erwin
···
-------- Original Message --------
Subject: Re: [Radiance-dev] behavior of 3ds2mgf (08-Okt-2008 10:42)
From: Bernd Zeimetz <[email protected]>
To: [email protected]
Hi,
could you send me a 3ds file to test this? I don't have any 3ds stuff
around.
Thanks,
Bernd
Erwin Zierler wrote:
> Hello all,
>
> I have two 64bit machines here running und Gentoo Linux. When compiling the
> latest HEAD everything works just fine, all executables are built.
> After running a few tests I discovered, that 3ds2mgf seems to be broken.
> This is the content of rmake:
>
> #!/bin/sh
> exec make "SPECIAL=" \
> "OPT=-O2" \
> "MACH=-Dlinux -D_FILE_OFFSET_BITS=64 -L/usr/X11R6/lib -I/usr/
> include/X11 -DNOSTEREO" \
> ARCH=IBMPC "COMPAT=erf.o" \
> INSTDIR=/opt/ray/bin \
> LIBDIR=/opt/ray/lib \
> ESUFFIX= \
> CC=gcc "$@" -f Rmakefile
>
> "3ds2mgf file.3ds" only produces "file.mgf" with this content:
>
> c R =
> cxy 0.640 0.330
> c G =
> cxy 0.290 0.600
> c B =
> cxy 0.150 0.060
>
> i file.inc
>
> and "file.inc" is empty. Can anyone reproduce this or maybe even better has
> a hint as to where I can start debugging this problem?
> It seems all 32bit versions (older compiles) run fine on the same systems,
> i.e. they produce the expected output.
>
> Thanks in advance,
> Erwin
>
>
>
>
> _______________________________________________
> Radiance-dev mailing list
> [email protected]
> http://www.radiance-online.org/mailman/listinfo/radiance-dev
--
Bernd Zeimetz Debian GNU/Linux Developer
GPG Fingerprint: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79