detect instances of model

Started by
8 comments, last by 215648 9 years, 11 months ago
Suppose I modeled a box in a 3d modeling package and placed 3 copy of them with different size. Now how do I detect this 3 instances while loading it in my 3d application?
Advertisement


placed 3 copy of them with different size

Do you mean different files? Or are you loading a single file and scaling the model in your application?

If they're different files, they would have different filenames or paths to distinguish them.

If you load a single model and scale it, you would know the scale you're applying.

Perhaps you can provide more information about what you're trying to do.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.


placed 3 copy of them with different size

Do you mean different files? Or are you loading a single file and scaling the model in your application?

If they're different files, they would have different filenames or paths to distinguish them.

If you load a single model and scale it, you would know the scale you're applying.

Perhaps you can provide more information about what you're trying to do.

no, I load directly my level model and it contains many instances of same objects. How do I detect this instances while loading model? (Via matching number of vertices or how?)

How are you creating your levels?

I would just store this information in the level file by writing the vertices of the object once

and have multiple references to this object each with a different position.

That depends entirely upon the format of the file i.e. does the format support groups somehow and are the different subsections identified as different groups etc.

If it is just raw vertex and face info then yes, of course you will have to use vertex count. What else did you have in mind?

Normally you would store the model once and apply different scaling matrices when rendering it.
I use udk for making level and then I export level model to .obj file format.
Okay. So different approach. Why do you have the same model in different sizes? What are you trying to achieve?

Okay. So different approach. Why do you have the same model in different sizes? What are you trying to achieve?

Because I'm creating a map and a map would have same model repeated many times. For example: you have one tree model and you draw it many times to make forest with API Instancing feature to reduce overhead.

Why do you believe that would take additional models? Do you have a reason instance scaling would not work?

The typical solution is to allow the engine to automatically scale things to different sizes for you; you provide only a single model nearest the 'ideal' size. The system can automatically scale, twist, and somewhat deform the foliage segments as they are generated. You only need to provide variations if they are more than the system can automatically generate.

Foliage usually is built from a very small number of models and textures, which is coupled with a lot of data about where each instance should be placed and deformed.


The same is true for most other objects as well. You build a small number of models and blueprints, and then create all the instances you need from them. There is no detection needed for that. Detection implies that your engine (in this case UDK) does not know about them. When you build your blueprints it knows everything about them, no detection necessary.

Why do you believe that would take additional models? Do you have a reason instance scaling would not work?

The typical solution is to allow the engine to automatically scale things to different sizes for you; you provide only a single model nearest the 'ideal' size. The system can automatically scale, twist, and somewhat deform the foliage segments as they are generated. You only need to provide variations if they are more than the system can automatically generate.

Foliage usually is built from a very small number of models and textures, which is coupled with a lot of data about where each instance should be placed and deformed.


The same is true for most other objects as well. You build a small number of models and blueprints, and then create all the instances you need from them. There is no detection needed for that. Detection implies that your engine (in this case UDK) does not know about them. When you build your blueprints it knows everything about them, no detection necessary.

I use that map in my own game from scratch but I just model level in UDK so I do not use UDK for making my game :p.

This topic is closed to new replies.

Advertisement