I want to read some models from diefferent files and want to arrange them in a scene.Is there any convenient way to do?
If I want to adjust models’ size and position relatively,what should I do?
Thank you!
Get yourself a tutorial on transformations in OpenGL (google or this website for example).
You do something like this in your rendering code:
// For each model you want to render
glPushMatrix();
glTranslate( ...);
glScale( ...);
// render one model here
glPopMatrix();
And repeat for each model, you can of course also put in a glRotate( …) when you need to rotate your model, make sure you put the rotate/translate/scale calls in the correct order depending on the effect you want.
mikael_aronsson,thanks for your help.But I have another question,is it possible to change the model itself which i want to read,other than change the view-model matrix or projection matrix. For example, how to use program to change the model from 3ds file?
U can do this,
first u need to make a common data structure which can represent the scene, (can think of scene graphs); then try building the translators… which can convert all u’r files into this data structures.
I don’t understand your meaning exactly.Would you please say it in more details?
Thank you!