- Forums
- Forum Help
- Search Forum
- Login
- Register
Truevision3D
>>
TV3D SDK
>>
TV3D SDK 6.5
(Moderators:
Waterman
,
Mithrandir_
,
beyonder
,
ZaPPZion
) >>
Preloading models
Pages: [
1
]
« previous
next »
Print
Author
Topic: Preloading models (Read 410 times)
Canning
Community Member
Posts: 592
Preloading models
«
on:
September 21, 2011, 05:27:22 AM »
I am after a little advice on something.
In my game,I am using quite a few 3d models. Currently, when I create a new 'enemy', I load a new model for it. I am wanting to preload the required models at the start of my game. I am thinking that i will create an array of them (an array of meshes) and when I create a new enemy, I will point its model to one that I have preloaded.
What is the code to do this? Is it just a simple 'Player(x).mesh = PreloadedMesh(1)', or do I use the clone method?
I am after the fastest way, most efficient way to do this.
thanks
«
Last Edit: September 21, 2011, 05:50:38 AM by Canning
»
Logged
I am using 2010 VB.NET and TV 6.5 with Windows 7
leghola
Customers
Community Member
Posts: 45
Re: Preloading models
«
Reply #1 on:
September 21, 2011, 09:22:06 AM »
In my project i have 2 class
First a MainMeshCollection without clone and all meshes with the enable status to false.
Secondly a InstanceMeshCollection that accept ALL mesh that could be viewed
When i load/update my scene, i search which mesh i must create. If i need to create a mesh then :
1. i search the mesh in the MainMeshCollection
1a. Search Ok : i create a new instance in the InstanceMeshCollection like this :
InstanceMeshCollection.mesh = MainMeshCollection.mesh.duplicate
1b. Search No Ok : i create this mesh in the MainMeshCollection and go to 1a.
Nico
Logged
i prefers live one day like a lion instead of one life like a dog...
Canning
Community Member
Posts: 592
Re: Preloading models
«
Reply #2 on:
September 23, 2011, 01:07:39 AM »
So the .duplicate method creates a copy of the mesh and is assigned to another mesh?
How much faster is this than loading a mesh from scratch?
Logged
I am using 2010 VB.NET and TV 6.5 with Windows 7
leghola
Customers
Community Member
Posts: 45
Re: Preloading models
«
Reply #3 on:
September 23, 2011, 04:50:59 AM »
Hi,
If you use load mesh, you create an access to the hard disk... It's bad.
If you use Duplicate, the mesh is loaded from HDD one time and after it's in memory, it's better, it's faster !
Nico !
Logged
i prefers live one day like a lion instead of one life like a dog...
Canning
Community Member
Posts: 592
Re: Preloading models
«
Reply #4 on:
September 23, 2011, 07:16:28 AM »
K, cool.
Logged
I am using 2010 VB.NET and TV 6.5 with Windows 7
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Truevision3D Official Information
-----------------------------
=> Development Information
-----------------------------
TV3D SDK
-----------------------------
=> TV3D SDK 6.3
===> Bugs
-----------------------------
Game Development
-----------------------------
=> Game Development
-----------------------------
Projects
-----------------------------
=> In-Development
=> Showcase
=> Recruitment
=> Announcements
-----------------------------
Truevision3D Official Information
-----------------------------
=> News and Announcements
-----------------------------
TV3D SDK
-----------------------------
=> TV3D SDK 6.5
-----------------------------
Game Development
-----------------------------
=> Engine Comparison
-----------------------------
TV3D SDK
-----------------------------
===> Shader Development
===> Content Pipeline
===> Bugs
-----------------------------
Game Development
-----------------------------
=> Companion Tools
=> Design and Theory
Powered by SMF 1.1.3
|
SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks