• Pointshop and PAC
    12 replies, posted
I don't understand how to use PAC to get values. [B]PAC shows this Position:[/B] 1.366 0.49 -7.766 [B]Angles:[/B] 4.416 -168.674 134.955 How do I put these in the LUA code for an item, like pos and ang:RotateAroundAxis? How do I know which one is Up, Right or Forward? Thank you.
Move and rotate with X,Y,Z. Here is an [URL="https://math-e-motion.wikispaces.com/file/view/0_xyz-coordinates.png/32885451/0_xyz-coordinates.png"]image[/URL] to visually understand.
[QUOTE=grazingbacon;41981366]Move and rotate with X,Y,Z. Here is an [URL="https://math-e-motion.wikispaces.com/file/view/0_xyz-coordinates.png/32885451/0_xyz-coordinates.png"]image[/URL] to visually understand.[/QUOTE] But what'-s the ang:RotateAroundAxis for X Y Z? In the default files it's ang:RotateAroundAxis(ang:Up(), right and forward.
Bump.
-snip- Now i understand what your getting at, basically you can use XYZ with positioning and setting angles. Cant tell you exactly which one rotates which way right now since i am on my phone. Just google "rotating around X Y Z" im sure an image could help you alot more.
[QUOTE=grazingbacon;41992376]-snip- Now i understand what your getting at, basically you can use XYZ with positioning and setting angles. Cant tell you exactly which one rotates which way right now since i am on my phone. Just google "rotating around X Y Z" im sure an image could help you alot more.[/QUOTE] I haven't been able to figure it out, I need the LUA functions that I should use for each one. Like, angle: 1 Do I use: ang:RotateAroundAxis forward? up? down? right? left?
[QUOTE][B]Position:[/B] X = 1.366 Y = 0.49 Z = -7.766 [B]Angles:[/B] X = 4.416 Y= -168.674 Z= 134.955[/QUOTE] [B]What XYZ does:[/B] [B]Position:[/B] X = Up-Down Y = Forward-Backward Z = Left-Right [B]Angle:[/B] X = (Rotate) Left-Right Y = (Rotate) Up-Down Z = (This makes the model "lean") Left-Right
[QUOTE=grazingbacon;41993441][B]What XYZ does:[/B] [B]Position:[/B] X = Up-Down Y = Forward-Backward Z = Left-Right [B]Angle:[/B] X = (Rotate) Left-Right Y = (Rotate) Up-Down Z = (This makes the model "lean") Left-Right[/QUOTE] Thank you, I'll try this later today and report back :)
[QUOTE=Busan1;41993486]Thank you, I'll try this later today and report back :)[/QUOTE] That is formatted for PAC, I am not sure how it will react with RotateAroundAxis. This may be easier to use with PointShop. [CODE]function ITEM:ModifyClientsideModel(ply, model, pos, ang) model:SetPos(Vector(X,Y,Z)) model:SetAngles(Angle(X,Y,Z))[/CODE]
[QUOTE=grazingbacon;41993673]That is formatted for PAC, I am not sure how it will react with RotateAroundAxis. This may be easier to use with PointShop. [CODE]function ITEM:ModifyClientsideModel(ply, model, pos, ang) model:SetPos(Vector(X,Y,Z)) model:SetAngles(Angle(X,Y,Z))[/CODE][/QUOTE] This won't work. The vectors need to be modified by their forward/right/up vectors and angles. Setting them like this will position the model without taking into account rotation. I'll look into making a PAC offsets to PS offsets converter.
[QUOTE=_Undefined;41993682]This won't work. The vectors need to be modified by their forward/right/up vectors and angles. Setting them like this will position the model without taking into account rotation. I'll look into making a PAC offsets to PS offsets converter.[/QUOTE] Yeah...came back on here to say that it doesn't work lol. Should of tested it before posting.
Sorry for posting in a 2 year old thread, but the thread never provided a solution, and this thread is what comes up when googling how to convert PAC positions to pointshop. I managed to solve it with lots of trial and error, so.. Even if OP solved this years ago, I thought it'd be helpful to finally complete this topic for those poor souls googling the issue. Note that it may or may not be [B]different for different bones[/B].. So this is only guaranteed to work for the "eyes" attachment, which you should use for hats.. So make sure you set the bone to "eyes" in PAC and attachment to "eyes" in the lua file if you're making hats. [CODE]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[/CODE] Just copy this code and change SCALE, X, Y, Z, PITCH, YAW, ROLL to the values PAC provides you. [B]Important: [/B]Note that in the code I have put -Y and -PITCH. This means that you need to negate the Y and PITCH values PAC gives you. For example, if PAC tells you "[B]-[/B]5 Y" and "23 PITCH", then you would set Y to [B]5[/B] and PITCH to [B]-23[/B]. [B]Edit:[/B] It may not always be -PITCH, on another item I made it was -YAW instead (maybe because it was rotated 180 on pitch?). so if you fail the first time, equip your Pointshop item and PAC item simultaneously and try negating pitch or yaw (or maybe even roll?) on your PAC item so it gets the same orientation as the failed pointshop item. That way you know which axises you need to negate in the lua file, so you should always get it right the 2nd time. When you get it right, the result is so spot-on that if you wear the pointshop item and the PAC item simultaneously, it will look like you're wearing a single prop.
My question is, which value is what direction in the first place on PAC? Because it's obviously not labeled... Is the order of PAC (forward, right, up?) then (right, up, forward) in the values?
Sorry, you need to Log In to post a reply to this thread.