Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Mo Jul 14, 2025 13:24

Foren-Übersicht » Sonstiges » Meinungen zu den Projekten
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 103 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3, 4, 5, 6, 7  Nächste
Autor Nachricht
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 13:20 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Hm, seems that it'll take me even longer. I've just found out that 3D Studio does not export a keyframe for every rotation. So in my sample, I have an object that gets rotated over 40 Frames (first 90° around Z, then 90° again, until 360°), so there should also be 40 keyframes in the 3DS-File. But that's not the case :( :
Code:
  1.   Frame no.10
  2.     Rad (rel) = 0,1712
  3.     Axis = 0,0000/0,0000/-1,0000
  4.     Quaternion = 0,9963/0,0000/0,0000/0,0855
  5.   Frame no.11
  6.     Rad (rel) = 0,1571
  7.     Axis = 0,0000/0,0000/-1,0000
  8.     Quaternion = 0,9969/0,0000/0,0000/0,0785
  9.   Frame no.26
  10.     Rad (rel) = 0,1571
  11.     Axis = 0,0000/0,0000/-1,0000
  12.     Quaternion = 0,9969/0,0000/0,0000/0,0785
  13.   Frame no.27
  14.     Rad (rel) = 6,1260
  15.     Axis = 0,0000/0,0000/1,0000

See that? After frame 11, there is a huge gap, and as frame 11 has the same rotation as frame 26 has, I really don't know what to do. There's no way to interpolate the missing frames between 11 and 26. So I don't know if that's a mistake of 3DS, and I also don't know what I'm supposed to do there. I just wish that documentation on 3DS was slightly better. I recently got ahold of an official (at least seems so) 3DS File format SDK from Autodesk themselves, but that also isn't very useful at all.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 14:20 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
take a look at how the milkshape animation in gl3ds works. It also only stores keyframes.

Either the animation does not change between keyframes or you have to calculate the inbetween frames yourselves.

_________________
http://3das.noeska.com - create adventure games without programming


Zuletzt geändert von noeska am Mi Aug 18, 2004 14:23, insgesamt 1-mal geändert.

Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 14:22 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
I know, but milkshape won't skip any frames. It seems to be very random when or wether keyframes in a 3DS file are skipped or not. So a look at the milkshape animations won't be much of a help. For most objects, the animations are stored as they should (i.e. if it's animated over 40 frames, there are 40 keyframes), but sometimes this is not the case. So I'm right now kind of clueless on that case, but I'll try to get it working...

Just read your edit : Sadly, that's not the case. The mesh IS animated between frame 11 and 26, so I don't know why that get's skipped. And as you can see, the quaternion for frame 11 is the same as for frame 26, so there is also no way to interpolate.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 14:27 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
maybe the rotation is not what is animated, but it is only translated?

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 14:34 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
No, something seems to be fishy here. I just dumped everything in my file using dump3ds from the official 3DS file toolkit, and it also shows the gap between frame 11 and frame 26, so I guess theres something wrong with that specific combination of rotation and mesh (maybe even the exporter of 3DS MAX is wrong). And as I said, most of the meshes have as much keyframes as I expected, and are therefore rotated correct, except this one. Let's see if I get this fixed.

P.S. : I'll attach the rotation data for that mesh. All rotations are relative and need to be converted to quaternions. This works for all meshes, except such meshes (as the one above) where there are frames just missing.

Edit : Very annoying : If I do this :
Frame 0-10 -> Rotate to 90° on Z
Frame 11-20 -> Rotate to 180° on Z
Frames are missing, but
Frame 0-10 -> Rotate to -90° on Z
Frame 11-20 -> Rotate to -180° on Z
All frames are present...but on the first one, 3DS MAX automatically changes the 180° to -180°, so the problem may lie in there.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 14:47 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
Zitat:
I just wish that documentation on 3DS was slightly better.

When you succed, you can change this... ;)

Did you store the key informations automaticly (Autokey) or manualy?

When nothing works, maybe the guys from 3DS can tell you why this special thing happens.

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 14:53 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Flash hat geschrieben:
Did you store the key informations automaticly (Autokey) or manualy?

Autokey, but that doesn't matter.

Flash hat geschrieben:
When nothing works, maybe the guys from 3DS can tell you why this special thing happens.

They won't. First, 3DS is outdated. Second, 3DS is a proprietary format, that you normally even aren't allowed to use without a proper license. So I guess they wouldn't help me at all, or even more would tell me to stop using the 3DS format.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 15:06 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
:x It really seems to be a problem with the way 3DS Max (R5) exports the animations to the 3DS-Format. I just exported my mesh and reimported it into 3DS MAX, and wow wow wow, what a surprise, the rotations were also wrong. So I now am quite sure that the problem lies within the export from 3DS MAX to .3DS itself, and it's not the fault of my way of doing the keyframes.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 15:55 
Offline
Guitar Hero
Benutzeravatar

Registriert: Do Sep 25, 2003 15:56
Beiträge: 7810
Wohnort: Sachsen - ERZ / C
Programmiersprache: Java (, Pascal)
Is the Animation itself displayed correctly when you play it in the 3DStudio? If that works, then something else must store information about the Animation.

_________________
Blog: kevin-fleischer.de und fbaingermany.com


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 15:57 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
I said above what's happening. It's a problem of the 3DS exporter in 3DS MAX R5. If I export it to 3DS and import it again from that 3DS into 3DS MAX, it's the same wrong animation sequence as in my app. So it's the fault of 3DS MAX's exporter.

To back it up, a screen montage :
Bild

Left is frame 30, reimportet from the 3DS-file. Right is frame 30 from the original MAX-file. As you can see, the left rotation is wrong. Below it, you can see the two animation tracks, the first one (correct) from the original MAX, and the second one (wrong) from the reimported 3DS. So I'll try to get ahold of another 3DS Max Version, to test the 3DS export there.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Aug 18, 2004 22:47 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Since I (until I get ahold of another version of 3DS Max, or another app that exports to 3DS) can't further work on that keyframe issue for now, I decided to upload the new unit here. But please note that it's still work in progress and maybe crash or do something it isn't supposed to do. Also please bear in mind that there maybe mistakes, cause most of the keyframe implementation is based on many hours of trial-and-error. So if you find any errors or mistakes, please let me know!


New functions you'll need for keyframe animations :
  • TAll3DSMesh.AdvanceKeyFramer
    Use this to advance the current frame of the keyframer by the given time "delta".
  • TAll3DSMesh.RenderKeyFrame
    Use this instead of plain Render to render your scene with applied keyframes.


Notes :
As usual, I've put very extensive comments into the sources that I changed. All changed/added functions/procedures/vars of types are denoted with a {!}. I've also added a global var named OwnerLog which is of type TMemo. If you assign a TMemo to that var, before loading a 3DS, then data concerning keyframes is dumped into the TMemo. The T3DSMesh has also a procedure called DumpKeyFrameInfos that can be used to dump all frames of that specific mesh into a TStrings var. Also right now, lerping between the quaternions of two frames (for smooth rotations) is broken (so it get's calculated, but is not used) and I also don't interpolate translations or scales.

Edit (19.08.2004) : Looks like I found out why some meshes seemed to be rotated wrong. If a mesh is not rotated, it's first frame seems to include it's rotation, so one need to skip that rotation. That's because the mesh get's exported with already rotated vertex coordinates. So please redownload the file.


Dateianhänge:
Dateikommentar: gl3DS.pas with keyframes (2.5)
WORK IN PROGRESS!
19.08.2004 - Wrong rotations fixed

gl3DS_with_keyframes.rar [26.31 KiB]
424-mal heruntergeladen

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)
Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Sep 15, 2004 10:09 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
I guess I stumbled (again, but that may be because I'm using gl3ds very often) over another bug. I'm for some days working a NGD (newton physics) demo that shows a racetrack, and yesterday I finished the car for that (my first self-modelled and textured car btw.) and put it in the mesh that also contains the racetrack and the terrain. But the problem is, that only on that mesh (the terrain and racetrack have no problem) the texture seems to be mirrored at the x-coords. Take a look at this :

Bild

Left is the car in my demo and right is the car as modelled in 3DS MAX. As you can see (red circled), the texture's x-coordinates seem to be mirrored (you can see it very good due to the text being reversed). But it only happens on that specific mesh (the others are fine), so I don't really know what's causing this. I've reimported the 3DS file into 3D Studio, and it displayed it correct. So it seems to be a problem with gl3DS and not (what I thought first) with the mes itself. Do you have any clues what could cause that? I've tried to track down the problem, but it seems that you load the texture coordinates correct.

P.S. : I'm using the newest gl3DS.pas, but threw out glBitmap.pas and replaced it with texture.pas. But that shouldn't be the problem, cause as said above the other meshes (all textures are JPGs) are textured correct.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Sep 15, 2004 10:46 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
When first using glbitmap all my textures appeared mirrored. But since you do not use that it cannot be the problem.

But, are you rendering the inside of the mesh? CCW vs CW?

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Sep 15, 2004 11:13 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
That's not the problem. The car belongs to the same file as the other parts of the scene (track, terrain, bridges), and get's drawn with the same call (although I put anything into an octree). And as the other meshes are textured correct, I don't know why that car has it's x-texcoords mirrored. The only thing different to the other meshes is the fact that I texturemapped that car usin 3D Studios UVW-Unwrap (that's the only way to texturemap a complex object). So I really don't know why the texture seems mirrored, and it's not the mesh itself.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Sep 15, 2004 11:30 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
could you try adding this line:

Code:
  1.  
  2.           FMesh[acount - 1].FMapping[i].tv := 1.0 - FMesh[acount - 1].FMapping[i].tv;
  3.  

As this is needed for some milkshape meshes. In your case you might need tu instead of tv.

to the TRI_MAPPINGCOORDS: part in Load3dsFromStream

place it directly after:
Code:
  1.  
  2. FMesh[acount - 1].FMapping[i] := tm;
  3.  


Don't know if it helps as i do not have a 3ds file that features this bug.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 103 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3, 4, 5, 6, 7  Nächste
Foren-Übersicht » Sonstiges » Meinungen zu den Projekten


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 5 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.012s | 16 Queries | GZIP : On ]