Jump to content

  • Log In with Google      Sign In   
  • Create Account

detect instances of model


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 newtechnology   Members   -  Reputation: 787

Like
0Likes
Like

Posted 18 May 2014 - 06:46 AM

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?

Sponsor:

#2 Buckeye   Crossbones+   -  Reputation: 6290

Like
0Likes
Like

Posted 18 May 2014 - 09:20 AM


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.


#3 newtechnology   Members   -  Reputation: 787

Like
0Likes
Like

Posted 18 May 2014 - 09:30 AM

 


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?)



#4 plainoldcj   Members   -  Reputation: 847

Like
0Likes
Like

Posted 18 May 2014 - 09:58 AM

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.



#5 Aardvajk   Crossbones+   -  Reputation: 6197

Like
0Likes
Like

Posted 18 May 2014 - 09:59 AM

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.

#6 newtechnology   Members   -  Reputation: 787

Like
0Likes
Like

Posted 18 May 2014 - 11:55 AM

I use udk for making level and then I export level model to .obj file format.

#7 Aardvajk   Crossbones+   -  Reputation: 6197

Like
0Likes
Like

Posted 18 May 2014 - 12:36 PM

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

#8 newtechnology   Members   -  Reputation: 787

Like
0Likes
Like

Posted 19 May 2014 - 12:14 AM

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.



#9 frob   Moderators   -  Reputation: 22719

Like
0Likes
Like

Posted 19 May 2014 - 12:30 AM

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.

Edited by frob, 19 May 2014 - 12:33 AM.

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#10 newtechnology   Members   -  Reputation: 787

Like
0Likes
Like

Posted 19 May 2014 - 12:53 AM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS