Re: Positioning a mesh???



Open up the .x file with an editor - you can see the coordinates that MAX
has created.

Or call the GetBoundingSphere method - it will return a center point of a
sphere which surrounds your entire object,

If you draw the Max model around the origin then directx will draw it around
the origin. Most modeles are generally drawn with their center at 0,0,0 as
that helps you canlculate the offsets

--
Zman (mailto:zman@xxxxxxxxxxxxxx)
http://www.thezbuffer.com
News and Resources for Managed DirectX


"Daniel" <DanielV@xxxxxxxxxxxxxxxx> wrote in message
news:%23MQkuFjtFHA.1472@xxxxxxxxxxxxxxxxxxxxxxx
> This soudns simple but for some reason i cannot do it.
>
> I made a model in 3D max and saved it as an x file, all fine. Then i load
> it in and draw it using the code at the bottom of this post. My problem is
> that my position i give it is actually offsetting it from its original
> position that it is loaded into the scene. If i remove my Translation it
> will draw the mesh in the scene but i have no idea what the x, y, z value
> is of it?
>
> So how do you find the position attributes of a mesh after loading it and
> how does directX know where to put it???
> public void DrawModel(Vector3 v3Position)
>
> {
>
> _renderer.Device.Transform.World = Matrix.Translation(v3Position);
>
> for(int i = 0;i < materials.Length; i++)
>
> {
>
> _renderer.Device.Material = materials[i];
>
> _renderer.Device.SetTexture(0, textures[i]);
>
> mesh.DrawSubset(i);
>
> }
>
> }
>
>
>
>


.



Relevant Pages

  • Re: Positioning a mesh???
    ... How do i use GetBoundingSphere though? ... > If you draw the Max model around the origin then directx will draw it ... > News and Resources for Managed DirectX ... >> position that it is loaded into the scene. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Positioning a mesh????
    ... This soudns simple but for some reason i cannot do it. ... in and draw it using the code at the bottom of this post. ... that it is loaded into the scene. ... the mesh in the scene but i have no idea what the x, y, z value is of it? ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Positioning a mesh???
    ... This soudns simple but for some reason i cannot do it. ... in and draw it using the code at the bottom of this post. ... that it is loaded into the scene. ... the mesh in the scene but i have no idea what the x, y, z value is of it? ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: 3d carton box printing
    ... In addition the way 3d graphics work you can scale any item you draw my any ... try to get a book on managed DirectX or follow some of the tutorials from ... label like product code. ... GDI printing commands to get it printed. ...
    (microsoft.public.vb.directx)
  • Re: Performance: VC++ 33% slower then Builder 5 on LineTo() API ca
    ... How come you are not using hardware to render your ... using DirectX to draw lines ... > helps I can disassemble both DLLs and post the code here! ... Our CAD application took 5 times longer to draw the same ...
    (microsoft.public.vc.language)

Loading