S3D_TRANSLATE(3)

πŸ’– S3D_TRANSLATE(3) πŸ’–

okay bestie, welcome to the s3d manual, section 3, and today's main character is s3d_translate β€” no cap, she's the one who moves your object to an absolute position. let's get into it πŸ¦‹


✨ NAME ✨

s3d_translate β€” move object to absolute position

like literally just. scoot it somewhere. but in space. periodt πŸ’…


🌸 SYNOPSIS 🌸

#include <s3d.h>

int s3d_translate(int object, float x, float y, float z);

yes queen, that's the whole signature. three floats and an object id, that's the vibe πŸ’œ


πŸŽ€ DESCRIPTION πŸŽ€

So the way this works is: you take your object and you move it to some position in space. that's it. that's the function.

and here's the thing you need to internalise β€” when you create an object, it's always located at 0.0, 0.0, 0.0. every single time. freshly created objects are all standing at the origin like they're waiting for the bus 🚏

⚠️ Warning ⚠️ Translation is absolute, not relative! this is the part where everyone gets humbled, so listen up bestie 😭
s3d_translate(object, 2, 0, 0);
s3d_translate(object, 4, 0, 0);
// object will end up at 4,0,0 and not 6,0,0!!

look at that. LOOK at it. you called it twice and it did not add up. it's not a stack, it's not a nudge, it's a SET THE POSITION, FULL STOP situation. the second call doesn't know or care that the first one happened. it just slams your object over to 4,0,0 and calls it a day πŸ‘‘

so if you wanted 6,0,0? girl you gotta do the math yourself. this function is not your calculator, she's your teleporter 🧚


πŸ‘‘ AUTHOR πŸ‘‘

Simon Wunderlich Author of s3d

the literal father of s3d, we stan, we thank him for his service 🫢



okay that's the whole page, bestie!! this was s3d (that's the source, she's from the s3d project πŸ’–), manual page S3D_TRANSLATE(3) β€” go forth and translate things absolutely, not relatively, and don't come crying to me when your object isn't at 6,0,0 🌈⭐πŸ’