Re: Positioning a mesh???

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



> Though I appreciate the reputation, "greatest" is a little more than I
> deserve.

"One of the" greatest, dude! That is, in the context of people who help
others with issues they have. Unfortunately, there aren't a whole lot of
them out there. Most of the experts don't seem to have the time or
inclination to share what they know.

--

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Zman" <zman@xxxxxxxxxxxxxx> wrote in message
news:ehOhALxtFHA.2568@xxxxxxxxxxxxxxxxxxxxxxx
> You are right. Its something I just happened to have never used but had a
> vague recollection of reading about it. I know I should have just looked
> in the documents to confirm it but I was feeling lazy yesterday :-) So I
> left my declaration as vague as possible rather than be wrong.
>
> Though I appreciate the reputation, "greatest" is a little more than I
> deserve.
>
> --
> Zman (mailto:zman@xxxxxxxxxxxxxx)
> http://www.thezbuffer.com
> News and Resources for Managed DirectX
>
>
> "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:eAa5GXstFHA.908@xxxxxxxxxxxxxxxxxxxxxxx
>>> Also .x files are generally ASCII (not sure if there is a binary format)
>>
>> I'm shocked, Zman! I have always thought of you as being one of the
>> greatest experts on Direct3D, and often use your web site as a reference
>> point. It surprises me to find out that you are "not sure if there is a
>> binary format." Of course, none of us knows everything about the
>> technologies we use (it is more helpful to know how to find out). Still,
>> I'm puzzled. Yes, there definitely IS a binary format.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> Neither a follower nor a lender be.
>>
>> "Zman" <zman@xxxxxxxxxxxxxx> wrote in message
>> news:e2GULwktFHA.3452@xxxxxxxxxxxxxxxxxxxxxxx
>>> Its in the Geometry class and its .ComputeBoundingSphere()
>>>
>>> Generally separate .x files is best, however I suspect there comes a
>>> point where opening lots of files would get expensive and it would be
>>> better to somehow pack them into a single file. You would have to
>>> experiment to see where that point is. Also .x files are generally ASCII
>>> (not sure if there is a binary format) so there is some overhead there
>>> too in the reading and parsing. So abstract the loading, do it with
>>> separate .x files now and if it gets too slow you can rewrite the loader
>>> later.
>>>
>>>
>>> --
>>> Zman (mailto:zman@xxxxxxxxxxxxxx)
>>> http://www.thezbuffer.com
>>> News and Resources for Managed DirectX
>>>
>>>
>>> "Daniel" <DanielV@xxxxxxxxxxxxxxxx> wrote in message
>>> news:Opd3%23nktFHA.256@xxxxxxxxxxxxxxxxxxxxxxx
>>>> Thanks for that i made sure my initial model was at 0,0,0 and it
>>>> worked.
>>>>
>>>> How do i use GetBoundingSphere though? I couldnt find that method
>>>> anywhere in the mesh class?
>>>>
>>>> Also if i was to make up a scene is it best to make all my models in
>>>> separate x files i presume? Then load them as and when they are needed?
>>>>
>>>> "Zman" <zman@xxxxxxxxxxxxxx> wrote in message
>>>> news:%233StX0jtFHA.2064@xxxxxxxxxxxxxxxxxxxxxxx
>>>>> 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???
    ... > Also .x files are generally ASCII (not sure if there is a binary format) ... > Generally separate .x files is best, however I suspect there comes a point ... >>> News and Resources for Managed DirectX ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: new here, my lang project...
    ... > binary format is easy. ... for navigation because the navigation is via parsing and ASCII ... interactions to invoke the behaviors tend to be high level. ... An abstraction disconnect. ...
    (comp.object)
  • Re: open email to the W3C
    ... A binary format is one where numbers ... It may know that hit-points of a character will never be ... how would you store strings in your binary formats? ... One way of encoding strings into binary files is called ASCII. ...
    (comp.lang.java.advocacy)
  • Re: Positioning a mesh???
    ... vague recollection of reading about it. ... >> Also .x files are generally ASCII (not sure if there is a binary format) ... >> separate .x files now and if it gets too slow you can rewrite the loader ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: help,how to convert a binary data file to ascii one?
    ... David Frank wrote: ... >> I just got a data file in binary format and want to convert them ... >>ascii text file. ...
    (comp.lang.fortran)