# Delete 'Mesh' Object In DX8.0 !!!

This topic is 4825 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

That's drive me crazy !!! I can't delete a mesh from a scene ... I just need to delete or replace it - as it were - with another x file during renderring . I'm using DX 8.0 in VB6 With due respect ...

##### Share on other sites
I'm sure you can...

What exactly is the problem. Are you getting a runtime error, or does the command you choose for calling it not working? How are you "deleting" it? Are you calling Release? How are you loading it are you using DirectX Enum loader?

##### Share on other sites

Actually, I heard there's no way to make an animation and see it in 'DX8' specially, so, I've got an idea boll down in make a separate X files which include one frame, and make an animation manually by render every x file one after the other and define a timely. ok

Now I want render 'mesh_1.x' and after a time replace it with 'mesh_2.x" and so on ...

I put a code of pick x in form load
Set Figure1 = D3DX.LoadMeshFromX(App.Path & "\mesh1_1.x", D3DXMESH_MANAGED, D3DDevice, Nothing, mtrlBuffer, nMaterials)

and now in a DO ... LOOP and in particular in a FOR ... NEXT which divide textures and materials on mesh :
                If kl >= 100 Then                    Figure1.DrawSubset I                End If                                If kl >= 200 Then                    Set Figure1 = Nothing                    Set Figure1 = D3DX.LoadMeshFromX(App.Path & "\mesh1_2.x", D3DXMESH_MANAGED, D3DDevice, Nothing, mtrlBuffer, nMaterials)                    Figure1.DrawSubset I                End If                                If kl >= 300 Then                    Set Figure1 = Nothing                    Set Figure1 = D3DX.LoadMeshFromX(App.Path & "\mesh1_3.x", D3DXMESH_MANAGED, D3DDevice, Nothing, mtrlBuffer, nMaterials)                    Figure1.DrawSubset I                End If

NOTE: kl just var which increase by one, mean "kl = kl + 1"

But it doesn't work, just happened a strange thing, that in 200,300,400,... every new mesh created on the previous without replace just add new and of course it made the loading too slow

I think you know what I mean now
That's what I want to do

Thanks

##### Share on other sites
Quote:
 Original post by Wolf_AttackActually, I heard there's no way to make an animation and see it in 'DX8'...

That's not true. There is actually an article somewhere on game dev on how to do it. Although it looks like you may be using C# (or else that is pseudo code), which I know nothing about.

Matt Hughson

##### Share on other sites
Is it just me or are you loading the same mesh for every iteration of the loops?
Also, I don't know what language you're programming with (looks like VB), but, is it enough to "Set Figure1 = Nothing" to unload the mesh?

Anyway, try this (pseudo-code):

for kl=0 to 99   figure1.DrawSubset Iend iffigure1 = nothingfigure1 = D3DX.LoadMeshFromX(App.Path & "\mesh1_2.x", D3DXMESH_MANAGED, D3DDevice, Nothing, mtrlBuffer, nMaterials)for kl=100 to 199   figure1.DrawSubset Iend if... // etc

##### Share on other sites
Do you know 'Kamikaze15' you gave me an idea although you wrote a stange code like : 'For' and 'End If' , but I think it just a little mistake .. and I told which programming environment I'm use in the first massage ...

Thank you, you gave me the solution ..

##### Share on other sites
Quote:
 Original post by Wolf_AttackDo you know 'Kamikaze15' you gave me an idea although you wrote a stange code like : 'For' and 'End If' , but I think it just a little mistake .. and I told which programming environment I'm use in the first massage ... Thank you, you gave me the solution ..

You're so right...
I'm just lacking of sleep.

Glad I could help though :)

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633283
• Total Posts
3011208
• ### Who's Online (See full list)

There are no registered users currently online

×