Dynamically Resizing Models: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
 
Another way to resize models
Line 10: Line 10:


I got rid of the code since then since it didn't do what I wanted, but just thought this should be documented in case we want to dynamically shrink/expand brushes later.
I got rid of the code since then since it didn't do what I wanted, but just thought this should be documented in case we want to dynamically shrink/expand brushes later.
Mappers can also do this [http://www.doom3world.org/phpbb2/viewtopic.php?t=15227 using the "rotation" key].


[[Category:SDK]]
[[Category:SDK]]

Revision as of 08:30, 24 February 2007

Originally written by Ishtvan on http://forums.thedarkmod.com/topic/2986

There's been a lot of questions about whether we can dynamically resize an entity ingame. Well, I think I did this by accident the other day. The key seems to be the following function:

void idEntity::SetAxis( const idMat3 &axis )

This is meant to re-orient the object to a given axis, and usually the axes are normalized so that each vector in the axis keeps a lenght of "1" and it doesn't rescale the entity. However, when I accidentally put a non-normalized vector in there, it actually shrank the object down. This happened for one of the crates in test_water. It was a result of a bug in my code, but I could get it to shrink down to about 1/4th its size and then come back up to the normal size. Pretty crazy.

It didn't mess up the textures or anything either, they seemed to stretch along with the object so that they kept their mapping coordinates relative to the object.

I got rid of the code since then since it didn't do what I wanted, but just thought this should be documented in case we want to dynamically shrink/expand brushes later.

Mappers can also do this using the "rotation" key.