Set scale for weapons
by Jason Burch · in Torque Game Engine · 01/13/2009 (8:13 am) · 12 replies
For some reason I can't set the scale for my weapons.
I don't have the source art or I would just go into blender etc and scale them via export.
I thought for some reason you could use %obj.setScale("1 1 1");
but that isn't working.
I also tried adding the onAdd function and setting the scale that way and it won't work.
any help is greatly appreciated.
I don't have the source art or I would just go into blender etc and scale them via export.
I thought for some reason you could use %obj.setScale("1 1 1");
but that isn't working.
I also tried adding the onAdd function and setting the scale that way and it won't work.
any help is greatly appreciated.
#2
thx for the comment.
01/13/2009 (8:41 am)
As noted above I don't have the source files just the DTS files so re-exporing isn't an option :(thx for the comment.
#3
01/13/2009 (9:28 am)
If you have access to blender? couldnt you just create a new sword?
#4
01/13/2009 (10:35 am)
Are your weapons mounted as images? There should be a datablock setting for image scale, shouldn't there?
#5
I tried putting scale = "0.5 0.5 0.5";
there and it didn't work
01/13/2009 (11:32 am)
Yes they are mounted as images.I tried putting scale = "0.5 0.5 0.5";
there and it didn't work
#6
01/13/2009 (12:41 pm)
I thought SMswords were banned long ago ;-)
#7
http://www.unwrap3d.com/
01/13/2009 (3:01 pm)
If you need to scale a dts object, look into Ultimate Unwrap. It has a dts importer/exporter and you can set the scale factor when you export the dts to a new one. http://www.unwrap3d.com/
#8
01/25/2009 (1:47 pm)
thank you so much Kerry I will try that.
#9
01/26/2009 (7:43 am)
Huh, that's a curious oversight. I would have thought that images would have a scale factor. That might be something to fix in a resource. I'll look into it when I have the time.
#10
01/26/2009 (7:49 am)
please if someone would that would be awesome
#11
First, you've got to add a new member to ShapeBaseImageData, a Point3F named 'scale'. In the definition of ShapeBaseImageData in shapeBase.h, look up the member 'Point3F shellExitDir'. This should show you how to add your on Point3F to the datablock. You'll need to modify the declaration of the datablock, the constructor, packData/unpackData, and initPersistFields.
Then, go to player.cc and find the method renderMountedImage. In it, there's a line
Note that since this hange is in Player::renderMountedImage, the scale member will only be used on images mounted on Players. Kind of sucks. If you really want, you can go through and modify all the ::renderMountedImage functions for classes like Vehicle.
01/26/2009 (12:57 pm)
Okay, I have a definite fix for this (I think), but I don't have time right now to go over every code change you need. I'll outline the process, and if you can't get it, I'll get back to you with detailed instructions.First, you've got to add a new member to ShapeBaseImageData, a Point3F named 'scale'. In the definition of ShapeBaseImageData in shapeBase.h, look up the member 'Point3F shellExitDir'. This should show you how to add your on Point3F to the datablock. You'll need to modify the declaration of the datablock, the constructor, packData/unpackData, and initPersistFields.
Then, go to player.cc and find the method renderMountedImage. In it, there's a line
dglMultMatrix(&mat);Directly beneath it, add this line:
glScalef(image.datablock->scale.x,image.datablock->scale.y,image.datablock->scale.z);That should allow you to specify an image 'scale' in the datablock.
Note that since this hange is in Player::renderMountedImage, the scale member will only be used on images mounted on Players. Kind of sucks. If you really want, you can go through and modify all the ::renderMountedImage functions for classes like Vehicle.
#12
01/26/2009 (9:52 pm)
thx I'll try that out.
Torque 3D Owner Edward