PointShop: Can't get model position right using PAC3

After some extensive Googling, I found this code:
[sp]
THIS CODE DOESN’T WORK PROPERLY - or maybe it does and I’m bad


function ITEM:ModifyClientsideModel(ply, model, pos, ang)
    model:SetModelScale(1,1,1) -- Scale of the ITEM.Model, x,y,z. Pretty sure.
    pos = pos + (ang:Forward() * 0) + (ang:Up() * 0) + (ang:Right() * 0) -- Position points starting at the Attachment or bone on the player. The direction is fairly self-explanatory. Numbers can be + or -
    ang:RotateAroundAxis(ang:Forward(), 0) -- Rotation on the axis in 360 degrees.
    ang:RotateAroundAxis(ang:Up(), 0)
    ang:RotateAroundAxis(ang:Right(), 0)
   
    return model, pos, ang
end

OP: reddit.com/48uhnr[/sp]

Update!
This is the code that works properly:


function ITEM:ModifyClientsideModel(ply, model, pos, ang)
	model:SetModelScale(SCALE, 0)
	pos = pos + (ang:Forward() * X) + (ang:Right() * -Y) +  (ang:Up() * Z)
	ang:RotateAroundAxis(ang:Right(), -PITCH)
	ang:RotateAroundAxis(ang:Up(), YAW)
	ang:RotateAroundAxis(ang:Forward(), ROLL)
	
	return model, pos, ang
end

Provided by Mornedil.
Careful with the Y and PITCH values, you have to “negate” them (see OP provided or my copy-pasta explanation here: http://forum.facepunch.com/showthread.php?t=1534079&p=51038320&viewfull=1#post51038320

Original post:
[SP]Using PAC3, I was able to achieve this:

https://s22.postimg.org/4rs2m3v9t/PAC3modelpos.png

Then I transferred the values over to my PointShop item:


ITEM.Name = 'Test Item'
ITEM.Price = 0
ITEM.Model = 'models/banana/banana.mdl'
ITEM.Attachment = 'eyes'
 
function ITEM:OnEquip(ply)
    ply:PS_AddClientsideModel(self.ID)
end
 
function ITEM:OnHolster(ply)
    ply:PS_RemoveClientsideModel(self.ID)
end
 
function ITEM:ModifyClientsideModel(ply, model, pos, ang)
    model:SetModelScale(1,1,1) -- Scale of the ITEM.Model, x,y,z. Pretty sure.
    pos = pos + (ang:Forward() * 1.906) + (ang:Up() * -0.057) + (ang:Right() * -73.516)
    ang:RotateAroundAxis(ang:Forward(), -6.891) -- Rotation on the axis in 360 degrees.
    ang:RotateAroundAxis(ang:Up(), -0.75)
    ang:RotateAroundAxis(ang:Right(), 0)
   
    return model, pos, ang
end

And the result was this:

https://s15.postimg.org/b8hstsl7v/GModhatpos.png

What am I doing wrong? I’ve tried flipping “pos = pos” and “ang:” but it results in a pretty similar position.

Oh, this also happens with every model of mine. Is there another tool I can use to get the position for these models?[/SP]

Try opening a support ticket with Kamshak on Scriptfodder

I’m not using any of their scripts (so no support ticket).

Using “PointShop by undefined,” the free one.

try chaning the postion (pos = pos + (ang:Forward() * 1.906) + (ang:Up() * -0.057) + (ang:Right() * -73.516)) manually as one user in redit already told you for example.
Its a pain in the ass, but… Better than nothing right?

Blegh. Was hoping it wouldn’t resort to that >.>

[editline]12th September 2016[/editline]

UPDATE:

I f*ckin’ fixed it! Well, I finally figured out how to use the original piece of code I found.

For future Googlers, here’s what to do:

Using PAC3, position the model how you want it.
IMPORTANT! if making a hat for PointShop, make sure to set the “bone” to “eyes” (just double-click to type).

The PAC3 values translations:
position X Y Z
angles PITCH YAW ROLL

Replace the values into this code, as provided by Mornedil:



function ITEM:ModifyClientsideModel(ply, model, pos, ang)
	model:SetModelScale(SCALE, 0)
	pos = pos + (ang:Forward() * X) + (ang:Right() * -Y) +  (ang:Up() * Z)
	ang:RotateAroundAxis(ang:Right(), -PITCH)
	ang:RotateAroundAxis(ang:Up(), YAW)
	ang:RotateAroundAxis(ang:Forward(), ROLL)
	
	return model, pos, ang
end


IMPORTANT! this code is a bit weird, in that you need to “negate” the values from PAC3 for this code’s -Y and -PITCH
If PAC3 shows -3.5 for the Y position, you’ll have to make it 3.5 (positive) and 5.5 for PITCH, you’ll have to make it -5.5.

Replace SCALE from the code with the value PAC3 gives you for “scale z z z”
All “z” values should be the same number, so if you get “scale 2 2 2” replace SCALE with just one “2” ( it should then look like model:SetModelScale(2, 0) )