Author Topic: Another ask for Egon!  (Read 5660 times)

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Another ask for Egon!
« on: January 08, 2006, 05:41:09 pm »
Hey Egon, can you please explain me about the .3ds estructure, I am doing a project similar to zinio for digital magazines, I needed to do a change of the page, but the project is in basic.NET, son I used another engine  :oops:  called irrlicht, but it supports animation with .x files and md2 files, not 3ds, the problem is that .x files does not support animation when deforming the mesh, only position, rotacion and bones but not mesh deformation, and thats exactly what I need, 3ds files support it, but irrlicht does not load animations on 3DS. So I was thinking on doing my own little engine just for loading 3ds animations.

How is the animation made in jpct? Where can I find usefull information? In my country is very very very very IMPOSIBLE to fins a book about engines, please help me with some links or explanations, about the renderer it can be with direct3d or OPENGL.
Nada por ahora

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Another ask for Egon!
« Reply #1 on: January 09, 2006, 05:03:59 pm »
jPCT's 3DS loader is based on a free document where somebody reverse engineered the file format. I just can't find the document anymore on my HD, so i can't help you very much in this aspect.

Animations in jPCT are simple keyframe animations. Search for that term, maybe in combination with "md2" and you should find something. Basically, it's simply linear interpolation of the vertices of the keyframes.

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Another ask for Egon!
« Reply #2 on: February 12, 2006, 03:54:38 am »
ok, understood, but how do you apply the textures?

I mean the meshes can be drawed using rect lines between the vertices and forming triangles, but how do I make a texture fit on the triangles, and how do you make them change when the perpective change?
Nada por ahora

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Another ask for Egon!
« Reply #3 on: February 13, 2006, 07:49:22 pm »
Basically like you do it with x/y-coords too when rendering a triangle. You just don't use  the projected 2D vertex coords (x',y') but the u/v-coords of the texture and interpolate them across the triangle edges and then inside each scan line. The remaining problem is, that u and v are not linear in screen space, so if you are doing it that way, the textures will start to wooble when perspective changes (can be seen on the Playstation 1 for example). So you interpolate u/z and v/z instead, which are linear in screen space (analog to x'=x/z). Now get rid of the z for each texel by dividing it by 1/z (which is linear in screen space too and therefore can be interpolated like u/v) and you are done.
That's a very brief description...google for perspective correct texture mapping to find better ones... :wink: