Advertisement

scaling question

Started by May 12, 2003 10:15 PM
3 comments, last by Steelrose 21 years, 9 months ago
I have a small problem and I need some help. I have a class that holds all the data for each object in my game. The trouble is I need to scale the object as it is placed in a gl list inside the class. Basicly it''s the same object but with different sizes in each object. Can anyone tell me where to put the glScalef when I create the object list or should I use another method? I can''t really use the glScalef outside the class because of the collision detection I''m using (coldet) as I have the collision cage in the object class as well. Thanks for any help.
Dreams arn't just dreams, They're a whole new world to play in.
surly you could just use glScale when rendering, and inversly scale the collision test when doing that? (ie, for a small scale model, increase the size of the test your running)

| - Project-X - my mega project.. close... - | - adDeath - | - email me - |
Advertisement
Problem is it doesn''t work like that. The coldet code is very specific about not using transformations on the cage. I could use glScale during rendering but I''d still need to scale the cage.

But I''ve been talking to one of my collage professors and I may have a solution. If it works I''ll post it here.
Dreams arn't just dreams, They're a whole new world to play in.
Why not scale all your vertices at loading time?

for (i = 0; i < numverts; i++) {
Vertex *= scalefactor;
// And whatever more you need to scale.. (normals, etc.)..
}
Yea, that''s what I was gonna do. And it worked. I feel kinda silly though, I thought it was gonna take a complex math formula to get this done.

Thanks for your help.
Dreams arn't just dreams, They're a whole new world to play in.

This topic is closed to new replies.

Advertisement