Jump to content
  • Advertisement
Sign in to follow this  
Wolf_Attack

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

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
Share on other sites
Thanks 'Matsy' for reply

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 this post


Link to post
Share on other sites
Quote:
Original post by Wolf_Attack
Actually, 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 this post


Link to post
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 I
end if

figure1 = nothing
figure1 = D3DX.LoadMeshFromX(App.Path & "\mesh1_2.x", D3DXMESH_MANAGED, D3DDevice, Nothing, mtrlBuffer, nMaterials)

for kl=100 to 199
figure1.DrawSubset I
end if

... // etc

Share this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Wolf_Attack
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 ..


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

Glad I could help though :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!