www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AGP on January 08, 2009, 04:23:21 pm

Title: Okino Website Claims 3DS Exports Cameras
Post by: AGP on January 08, 2009, 04:23:21 pm
Which, come to think, I'm sure I've seen done. Can we PLEASE get that implemented? It would change my life on 3D/2D hybrids like the game on which I'm currently working.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: fireside on January 08, 2009, 05:58:18 pm
It is able to do lights and cameras, but a lot of modelers don't put it in their exporter.  Blender doesn't.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on January 08, 2009, 06:26:56 pm
I know but I use Max, so I'm covered.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: paulscode on January 08, 2009, 09:46:51 pm
Interesting idea.  I'm wondering where would that information be used by jPCT, though?  For example, if you loaded multiple 3DS files with various camera informations into different Object3D's, what would jPCT do with that information (since there is, of course, only one Camera for the World)?  Or would the point be to use that information to determine each model's initial scale and rotations, perhaps?
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on January 08, 2009, 09:57:24 pm
I'm thinking a Camera[] Loader.load3DScamera(String, float) method. That way, you would load the cameras from only the files you wanted, and would set only the camera you wanted for the world at a time.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: paulscode on January 09, 2009, 01:49:23 am
Oh, I see - to be able to define various stationary camera-views of a scene.

I could see how that would be useful - might save a little time since setting a camera graphically is somewhat easier than doing it programatically.

I was thinking, without a 3DS camera loader, you could do something similar by placing a seperate object into the 3DS model in the position and orientation that you would like the camera to be.  It could consist of a right-triangle with three vertices ("position", "up", and "look").  Using the vertice positions you could define a camera position, look-direction, and up-direction, and use the Camera.setOrientation() method to move the camera to that view.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on January 09, 2009, 02:20:29 am
No, not just to save time or formultiple views. My background, in this case, is 2D. Several objects on the foreground are 3D. Plus, there's a 3D plane on which the characters walk. But these object won't line up perfectly unless the camera is the exact same way. But there are differences in apperture and other things that just makes this impossible to do manually. I've tried everything. I come close to matching the cameras, but coming close is not nearly enough.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 09, 2009, 01:01:19 pm
I took a look at the specs for 3DS that you've provided. Somehow i'm missing the CAMERA_SEE_CONE description, which is actually the most interesting part of it all... :-\
However, to give this try, i need an example. I need a 3ds scene with a camera from which i know how it should look like. Is it actually possible to get the camera settings in 3ds/max (editable in a dialog or something)? So that i could verify that my values from the file are the ones that 3ds uses too?
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on January 09, 2009, 03:13:57 pm
E-mailed a 3DS of a sheriff sitting down and a camera placed in front of him to you.

I'm not sure what you mean by "is it possible to get the camera settings in MAX in a dialog" but the coordinates for its position are -0.203, -22.073, 6.882. Thanks again, buddy.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: paulscode on January 09, 2009, 03:39:59 pm
But there are differences in apperture and other things
Good point, camera views are a bit more complicated than just position and orientation.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 09, 2009, 04:04:37 pm
I'm not sure what you mean by "is it possible to get the camera settings in MAX in a dialog" but the coordinates for its position are -0.203, -22.073, 6.882. Thanks again, buddy.
What about the camera's orientation and the fov? Can you provide me a screen shot from MAX, that shows how the scene looks like, if viewed correctly?!
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 09, 2009, 04:06:54 pm
Good point, camera views are a bit more complicated than just position and orientation.
Yes, there's the field of view in addition...and that's the part, that the specs seem to omit...
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on January 09, 2009, 04:18:29 pm
E-mailed you a screenshot. Thanks again.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 09, 2009, 10:18:39 pm
E-mailed a 3DS of a sheriff sitting down and a camera placed in front of him to you.
Well, that file contains no 4700H section, i.e. no camera information is in there... ???
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on January 10, 2009, 11:28:19 pm
Do you want the MAX scene itself? Because I re-sent you the 3DS two days ago. But with the MAX scene you could export via other 3DS exporters (like Okino's).
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 11, 2009, 07:13:58 pm
No, i don't have MAX and i have exporter that exports from MAX without MAX being installed. I haven't looked at your last file yet, because i'm feeling quite sick ATM...i'll do later.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on January 12, 2009, 09:49:40 pm
Sorry about that, pal. Get better soon.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 13, 2009, 08:07:47 pm
Ok, i've tried the new model that you've exported...still no camera, i.e no 0x4700 chunk in it. I can't write that method without a working file, because i have no clue what the values actually mean that the specs mention. I've to get them from the file and try to find out. If they are not in the file, i'm stuck... :(
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on January 15, 2009, 12:31:02 am
Is the following link to a PRJ file the same thing as a 3DS? It has both cameras and lights, and it looks like pretty much the same thing to me.

http://wolf359a.anet-stl.com/mesh/xwing.zip (http://wolf359a.anet-stl.com/mesh/xwing.zip)
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 15, 2009, 08:06:20 pm
Is the following link to a PRJ file the same thing as a 3DS? It has both cameras and lights, and it looks like pretty much the same thing to me.
No, it's different. I've no idea what exactly is different, but i can't load it. Have you looked at the OBJ-format? Maybe that can hold camera information? It would be easier to deal with, because that format is actually ASCII based.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: fireside on January 16, 2009, 12:23:56 am
What about putting a cube where the camera is and then replacing it with the camera?  I have no idea if that would work or not.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on January 16, 2009, 03:40:09 am
As far as I can tell, the only file format supported by jPCT that stores camera data is 3ds. Give me until Saturday and I'll get PolyTrans so I can send you a model with the camera data. And thanks again.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on January 30, 2009, 02:05:43 pm
For what I've been playing around, 3ds stores more than one camera. I've created two files, the a3dring1.3ds has one camera (DefCamera & DefCamera.Target), and a3dring2.3ds has two (DefCamera & DefCamera.Target + DefCamera7 & DefCamera7.Target).

http://student.dei.uc.pt/~jcgonc/a3dring.rar (http://student.dei.uc.pt/~jcgonc/a3dring.rar)
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 30, 2009, 02:50:54 pm
Thank you for the files. I'll have a look at them...
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 30, 2009, 03:42:26 pm
Ok...these files do contain camera information. However, i've no idea what to make from it. ring1 looks pretty good so far. I can extract the camera information and it is the same that DeepExploration (my 3ds viewer) prints out. But ring2 is different. I get two cameras from it. According to DeepExploration, they both have different positions and the same target. I get the target just fine for both, but my positions are completely different. For the first camera, i get 0,0,0, which is very strange IMHO. For the second position, i'm getting the same value as for ring1...which is not what i'm getting in DE. Looks like as if some kind of offset is applied silently, but no matter what i try to match it...it makes no sense to me.
In addition, i can read the fov just fine, but the angle (i assume it defines a rotation around the camera's axis or something) is always 1, which it obviously isn't. I'm reading the data according to the inofficial 3ds specs from AGP and it makes kind of sense, but something seems to be missing.

C3R14L.K1L4, can you tell me what the actual values for the camera in 3ds are? Maybe you can make a screen shot of the camera dialog (given that such thing exists and that it contains some numbers...).

 ??? ??? ???
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on January 30, 2009, 06:26:08 pm
...Those cameras were added on DE...  ::)
I'm pretty sure the second ring's first camera is the same as the first ring, and what I'm seeing on DE is that all cameras of ring1 and ring2 are different. (I may be wrong, I'm quite tired...)
I don't have 3ds (and I don't know how to use it). I've checked with wings3d, it doesn't export camera information so I'll check with sketchup.

Just a question, if an object has multiple cameras, will be the "first" one be returned or will it get all of them (in a array or similar) ?
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on January 30, 2009, 06:57:09 pm
I've checked and sketchup generates multiple cameras from multiple pages. So I exported from sketchup, compared with the cameras on DE and they're the same (5 cameras)
http://student.dei.uc.pt/~jcgonc/Untitled.3ds (http://student.dei.uc.pt/~jcgonc/untitled.3ds)
The camera's position values from DE are OK.

Edit: I've updated the file with cameras position on some of those triangle's vertices. If you need, I can build a cube with 8 cameras on each vertex  :P
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 30, 2009, 08:13:39 pm
Just a question, if an object has multiple cameras, will be the "first" one be returned or will it get all of them (in a array or similar) ?
If i get it to work, then all of them...if not, then none... ;D The problem is, that i have no idea what those values that i'm reading from the file actually mean. Sometimes they match the DE data, sometimes they are totally different. Another thing that confuses me: When checking the data in DE, i get a position of, let's say, 10,-10,20 and a target of 10,0,-90. When clicking on the third tab in the camera's properties (i forgot the name of it), it tells me something about origin and target. What is that? Origin seems to be the camera's position. Target seems to be origin plus some offset but that offset has nothing to do with the actual camera's target...i don't get it... ???

Maybe a cube with cameras on the corners would be really helpful...
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on January 30, 2009, 10:33:37 pm
Hum, the third tab on my DE is 'atributes' and appears empy for both cameras (Scene_x) and camera targets (Scene_x.target). The 'origin' and 'target' I found (which appear on the object tab, local coordinates) are the same for all the cameras.
For instance, for the 5th camera (scene_5) I get this on the summary page:
Code: [Select]
World Org : 74.644310,533.166260,21.352112
World Target Point: (-17.981171,-471.322479,21.352112),
Vector: (-0.091822,-0.995775,0.000000)
World Up Point:  (74.644310,533.166260,1030.102417),
Vector: (0.000000,0.000000,1.000000)
View X="95.2684"    Y="180"     Z="-180"
The only item I haven't understood is the 'View X'. It seems to change with rotations on the camera. ::)
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 30, 2009, 11:16:07 pm
I'm using version 2.0 of DE...rather old, i suppose. When clicking on a camera, i have three tabs (Transformation, Camera, Information). Information is the one that makes me wonder...what i get there is something like this:

Code: [Select]
Cast Shadows
Receive Shadows
Org : 252.818,-452.969,218.479
Target : 252.818,-452.969,217.479
Up : 493.875,-359.19,762.933
Animation:
Position , 1 keys
time: 0.000000 pos(252.818100,-452.969116,218.479477)

Where Org is the camera's position as shown on the Transformation-tab. But what is Target? In this example, the actual target is 1.948273,-0.000000,-90.091202...this has absolutely nothing to do with the value above!? And what kind of up-vector is that? Shouldn't an up-vector be normalized? It's quite confusing...
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on January 31, 2009, 12:24:31 am
The information you show is for which camera?
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 31, 2009, 08:57:57 am
Camera7 of the second ring example.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on January 31, 2009, 11:14:04 am
Sorry  ;D but I deleted the file, I thought you would be using the single 3ds I uploaded recently.
If you wouldn't mind to mail or give a link so I can check it...
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 31, 2009, 01:06:51 pm
I'll just continue working with the latest example, no problem. So i tried to read that one...the results are, as expected, different from the former files. This is what i get for all 5 cameras:

Code: [Select]
----------------------------------
Camera:
x= -103.36
y= -490.54068
z= -17.66559
tx= -790.4902
ty= 93.751114
tz= -85.55919
a= 0.0
f= 51.42857
----------------------------------

----------------------------------
Camera:
x= -103.36
y= -45.35763
z= 7.392467
tx= 587.8376
ty= 533.63574
tz= 79.27386
a= 0.0
f= 51.42857
----------------------------------

----------------------------------
Camera:
x= 225.34636
y= -14.016275
z= 12.724576
tx= -537.1037
ty= -500.6622
tz= 12.724576
a= 0.0
f= 51.42857
----------------------------------

----------------------------------
Camera:
x= -2.0265538E-6
y= -45.35763
z= 153.8393
tx= -720.77325
ty= 501.12222
tz= 153.8393
a= 0.0
f= 51.42857
----------------------------------

----------------------------------
Camera:
x= -25.355688
y= 433.1663
z= 21.352112
tx= -17.98117
ty= -471.32248
tz= 21.352112
a= 0.0
f= 51.42857
----------------------------------

Now, all positions (x,y,z) are correct (when compared to DE). All targets are correct anyway, they always were...
The information tab shows (with (x,y,z) being the camera's position):

(x,y,z) = Org
(x,y,z-1) = Target
(x,y,z+1) = Up

for all cameras but the last two. There, the z-values of the up-vectors are completely off...something like z+10xx. So maybe "Information" is just bogus, who knows.

Anyway, in the two older ring files, f (which is the FOV value) always was correct, i.e. the value in DE was equal to what i got. In this file, this isn't the case. DE tells me, that the FOV is 46.6667° but i'm reading 51.42857° from the file. In addition, the angle is always 0 in this file. It was 1 in the others (which doesn't make more sense, it's just different).
Plus DE gives me a "roll"-value (i don't know where that comes from), which is always 0 in the new file. For ring1 and ring2, it was something like 330-359.999... ???

To summerize this, we have three different behaviours:

ring1: Position and target were correct, angle was 1, fov was correct, roll was 359.999
ring2: Positions were bogus, targets were correct, angle was 1, fov was correct, roll was 349.999 and 330.999
untitled: Positions are all fine and so are the targets, angle is 0, fov is bogus, roll is 0

For all of them the data in the Information-tab is..whatever...

Does this make any kind of sense? The parsing and reading of the 3ds file is correct btw. It uses the same methods to extract the camera data that are used for the rest of the file, so if that would be wrong, the whole loader wouldn't work. I've re-read the specs, but can't find anything else that is camera related. I've no idea what's going on here and i really start to hate the 3ds format...

Edit: No, i actually hated the 3ds-format before... ;)

Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on January 31, 2009, 06:01:53 pm
Indeed, I don't like 3ds too (both the file and the "proggy"). First of all, it's binary, making me difficult to edit the information by hand (for instance, replacing all vertices with Y of 0.3 to -0.3, mantaining the others). Second, it's documentation is quite complicated (for me), all that stuff of chunks or sections, etc. (like the bsp's lumps). Brrrr.... Wavefront Object rules !!! :D

Now, about the file. I've installed Cinema4D just to try (don't ask me where I got it  ::)), and for it, the "f" values (51.42857) is the Focal Length, equal for all the cameras. I also get (for them all), aperture width = 36 and FOV (actually, the correct term is AOV, angle of view) = 38.58º, again equal for all of them.

I checked some one of the 'unofficial' 3ds specifications and as you may now, the camera lump (4700h) only has position, target, 'bank' and 'lens' information, so the aov (fov :P) is computed from both bank and lens values. Googling a little (with angle of view), I got this from the wikipedia:
http://en.wikipedia.org/wiki/Angle_of_view (http://en.wikipedia.org/wiki/Angle_of_view)

a = 2*arctan(d/(2f)),

where "a" is the aov, in radians, "d" is the 'aperture width' and "f" the focal length, which are the values C4D gives.
The 'code' you show, is it the data acquired by your parser? I.e., "a" is the specification's "bank" parameter and "f" is the "lens" one?

Finally, roll is the rotation on the object's Z axis (planes xOy, what in jPCT appears as rotateZ).
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on January 31, 2009, 08:04:19 pm
Now, about the file. I've installed Cinema4D just to try (don't ask me where I got it  ::)), and for it, the "f" values (51.42857) is the Focal Length, equal for all the cameras. I also get (for them all), aperture width = 36 and FOV (actually, the correct term is AOV, angle of view) = 38.58º, again equal for all of them.
Which leaves the question why DE says it's 46,6666°!?

I checked some one of the 'unofficial' 3ds specifications and as you may now, the camera lump (4700h) only has position, target, 'bank' and 'lens' information, so the aov (fov :P) is computed from both bank and lens values. Googling a little (with angle of view), I got this from the wikipedia:
http://en.wikipedia.org/wiki/Angle_of_view (http://en.wikipedia.org/wiki/Angle_of_view)

a = 2*arctan(d/(2f)),

where "a" is the aov, in radians, "d" is the 'aperture width' and "f" the focal length, which are the values C4D gives.
The 'code' you show, is it the data acquired by your parser? I.e., "a" is the specification's "bank" parameter and "f" is the "lens" one?
Yes, a is bank and f is lens. The formula is fine, but where do i get d from?
Edit: Or is it safe to assume that d is fixed at 36? Seems to be a popular value for cameras according to google...

Finally, roll is the rotation on the object's Z axis (planes xOy, what in jPCT appears as rotateZ).
I thought so too, but where does this value come from? The 4700-chunk doesn't have it, does it? At first i thought that it can be calculated from a (bank, angle...), but obviously it can't. And i can't find any other chunk that contains it...

BTW: I'll keep calling it fov. I've never read the term aov in 3d graphics related stuff... ;)
BTW 2: Thank you very much for your efforts. I really appreciate them.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on February 01, 2009, 01:22:04 am
I've been "playing" with 3ds max for some time and with winhex (nice hex editor) and I came to the conclusion that the FOV (AOV :P) is not stored on the camera chunk (0x4700). When I change the FOV on 3ds max, the f value of the camera chunk changes, but another value on another chunk (which I have not discovered yet on the documentation) also changes. Actually, this value is always the fov value, in degrees (and stored as float).

Oh well, in the meanwhile, I've also done a table giving the relation I've found between FOV and the 'f' value:

Code: [Select]
FOV Focal Length
0,5 4800
2 1200
3 800
10 240
15 160
30 80
45 53,33333333
50 48
60 40
70 34,29
80 30
90 26,66666667

As I said, the f value changes with fov, but not vice-versa, i.e., the fov can't be (or shouldn't be) directly taken from f. Doing some math you can probably get a function giving one value from the other...
Now, I've got to study for an exam :P The sooner I'm available, I'll give you more about that unknown chunk.
No need to thanks, always ready to help!
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on February 01, 2009, 09:58:20 am
As I said, the f value changes with fov, but not vice-versa, i.e., the fov can't be (or shouldn't be) directly taken from f. Doing some math you can probably get a function giving one value from the other...
You've already given that function (it's that arctan-thingy) and it works fine as long as i assume that d is 36 (have to convert it to radians before, but anyway...). The question is, if this is save...(most likely not...)?
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on February 01, 2009, 03:26:38 pm
The question is, if this is save...(most likely not...)?
Sorry, I did not understood. The 3ds I analysed (excluding the ring ones) were all exported from 3ds max.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on February 01, 2009, 04:12:56 pm
The question is, if this is save...(most likely not...)?
Sorry, I did not understood. The 3ds I analysed (excluding the ring ones) were all exported from 3ds max.
;D That's most likely because i spelled safe wrong... ::) what i meant was if it is safe(!) to assume that d is always 36. Because if it is, f can be used to calculate the fov. If it's not, d has to be stored somewhere else in the 3ds and the question is where...
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on February 01, 2009, 05:44:40 pm
But as I said before, if I save a 3ds from 3ds max with camera's fov (in the program the parameter is called FOV, not AOV :D) set to 30º, you can read from your parser 'f' = 80.0 but if you change this parameter in the same file, for instance to 40.0, and import it to a new scene in 3ds max, you'll get the old 30º fov... and not 60º as you expected (in the table)... :-\

I.e., officially, fov is got from the other chunk, not from the 'camera' / 0x4700 one :P
To be exact, IMO this is quite stupid... two related parameters for the same thing... (as I can think of).
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on February 01, 2009, 07:06:57 pm
Thank you, C3R14L.K1L4 and Egon for picking this up without me. I've been spending way too much to buy Okino's exporter! I've got my fingers crossed that Egon will find a way.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on February 01, 2009, 08:09:18 pm
I.e., officially, fov is got from the other chunk, not from the 'camera' / 0x4700 one :P
To be exact, IMO this is quite stupid... two related parameters for the same thing... (as I can think of).
I got it now, but it doesn't matter to me as long as f in 4700 is valid when saving the file in a normal way, i.e. without using a hex editor to edit it. What does happen to f if you save the edited file again? Does it change?
Reading fov from another chunk than the camera's is really stupid as you have to match it somehow to the corresponding camera...*'"$%!"## 3DS-format!
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on February 03, 2009, 12:18:01 am
Reading fov from another chunk than the camera's is really stupid as you have to match it somehow to the corresponding camera...*'"$%!"## 3DS-format!
That's the problem of closed / private file formats... Ahead, this is what I've done:

Exported a 3ds from 3dsm contaning a 'targetable camera' with FOV = 45º.
Read 'f' from the file with 53.3(3) and changed it to 40. Saved the file.
Loaded the scene from the file in a new scene in 3dsm. FOV still is 45º.
No editing, just exported the 3ds and overwrite the file. Read 'f', it got back to 53.3(3).

Now the roll, it's also stored in that strange chunk, which I have not yet discovered it's identifier. The roll specificies this camera rotation (the skillfully drawn arrow ;)):

(http://img119.imageshack.us/img119/9773/image1jh0.png)

This is the actual file structure (another skillfully drawn picture):

(http://img129.imageshack.us/img129/4522/image2ta2.png)

This is the same camera like before, I just altered the roll to 45º (0x00003442). I have a feeling that 'camera chunk' is deprecated ::)
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on February 12, 2009, 01:12:00 am
I've played with this for a whole day and I couldn't retrieve that chunk's id... Perhaps my brain's low on fuel, but I think we need a real hacker here. I've also checked jme (j monkey engine) and it has some code to process the camera chunk, but does nothing with it. About the unknown chunk, there's no reference to it in jme's source.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on February 12, 2009, 08:04:41 am
This is so annoying...i'll try if i can make something out of it when i find the time...
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on April 06, 2009, 11:02:31 pm
I don't suppose you've had any progress here, have you, Egon?
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on April 06, 2009, 11:35:26 pm
By the way, what are the camera settings for jPCT's cameras for field-of-view and lens millimeters?
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on April 07, 2009, 07:36:38 am
The default fov is defined in Config.defaultCameraFOV and it's 1.25. I don't know anything about lens mms. I never understood why on earth people think of mm and lenses when rendering to a screen...  ???

And no, there hasn't been any progress. I'm stuck here. I've no idea where to get the needed values nor to i know what some values mean that i'm getting. I can't find any information about it. The camera related code in the loader has been commented out for now, because it only loads half as much as it should to be useful.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on April 08, 2009, 01:54:17 am
What about supporting DXF, which stores lights and cameras, or at least Lightwave's (.lwo/lws), or OpenGL (.c) (though DXF is better because EVERYTHING exports DXF)? Pretty please? I need to be able to transfer my camera perfectly.

EDIT:
Here's a link to the DXF file description: http://www.martinreddy.net/gfx/3d/DXF12.spec (http://www.martinreddy.net/gfx/3d/DXF12.spec)

And this is a different 3DS page (probably more helpful than the first link I sent you: http://www.martinreddy.net/gfx/3d/3DS.spec (http://www.martinreddy.net/gfx/3d/3DS.spec)
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on April 08, 2009, 07:21:56 am
I already know these specs...there aren't helpful either. Before including another obscure file format with other problems, i would rather fix the existing ones. Can't OBJ hold these damn camera information? Have i asked that before...( i guess so...)?
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on April 08, 2009, 07:27:18 am
You have and I said "the only jPCT-supported format that stores cameras is 3DS." One more format wouldn't hurt the engine, I assure you. Hey, one of the things I love about jPCT is that it's so intuitive. I want it to stay that way. But adding a file format wouldn't make the Loader class (itself pretty self-explanatory) clobbered.
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on April 08, 2009, 08:56:51 am
Are you sure? I dimly remember something like camera information in an OBJ-file that i saw once...i just can't remember which one it was!

No, adding another file format wouldn't make the Loader clobbered...but it takes time to implement it (which i don't have ATM) and there are only two options:

a) the format is easy to grasp at first glance (like OBJ) but comes in a gazillion of absurd variants
b) the format is like 3DS...an undocument, binary mess

Neither is fun. Or to put in other words: Writing loaders stinks!

BTW: jPCT doesn't prevent anyone from writing his/her own loader...it can always be added to the Loader class later... ;)


Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: AGP on April 08, 2009, 09:14:17 am
OK, I could try one. I did, 10 years or so ago, write an OBJ one myself, but you're a better programmer than me. But how would I go about doing it? object = new Object3D(maxNumberOfTriangles) then object.addTriangle(SimpleVector, SimpleVector, SimpleVector)?
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on April 08, 2009, 10:32:12 am
Yes. If it finally works and makes its way into Loader, i can use some internal shortcuts that may help with performance, but afterall, most Loaders do exactly that (i.e. new Object3D()/addTriangle()).
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: C3R14L.K1L4 on April 22, 2009, 04:56:49 pm
Egon, how is it going? Solved the 3DS problem?
I've checked wavefront's specs and theres no camera information tag :-\
Title: Re: Okino Website Claims 3DS Exports Cameras
Post by: EgonOlsen on April 22, 2009, 05:02:46 pm
Egon, how is it going? Solved the 3DS problem?
Not by me. I've no idea what to make out of the data that i read from the 3ds file.