xboxscene.org forums

Author Topic: 3d Object Conversion  (Read 57 times)

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
3d Object Conversion
« on: January 17, 2003, 07:36:00 AM »

Yeah, I'm having the same issue... I was just playing around, so I didn't mess with it too much, just replacing the "tiger" object with my own.

The doco does mention something about scaling up by a factor of 100, though...
Logged

DevSpook

  • Archived User
  • Newbie
  • *
  • Posts: 31
3d Object Conversion
« Reply #1 on: January 17, 2003, 04:07:00 PM »

Figured it out, there is actually nothing wrong with the conversion, just the rendering settings.

What you need to do to make it work is position your camera appropriatly AND adjust the near/far clipping planes to match your object(s).

If you use the -x parameter to convert to a text .x file you can easily check the bounding coordinates of your object. Use the max values to determine the values to use. In my case, a sphere with a radius of 500, i used:

   D3DXMatrixLookAtLH( &matView, &D3DXVECTOR3( 0.0f, 0.0f,-500.0f ),
                                 &D3DXVECTOR3( 0.0f, 0.0f, 0.0f ),
                                 &D3DXVECTOR3( 0.0f, 1.0f, 0.0f ) );

To move the camera far enough away from the object to see it, and:

   D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 1000.0f );

To allow it to render the whole object without clipping the far plane. The last parameter is radius*2, the second to last is the near plane relative to your camera position.



Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
3d Object Conversion
« Reply #2 on: January 17, 2003, 04:32:00 PM »

Thanks!

I'll have to play around with that this weekend.
Logged