Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
dizzywhip
Dec 23, 2005

I'm implementing a skeletal animation system, and overall it's working well, but I'm running into an issue with the orientation of attach points on the model that I'm syncing to the animation.

For certain joint rotations, the attached object takes on an additional unwanted rotation. For example, here I'm rotating the shoulder around the Y axis with an attach point sticking out from the end of the arm represented by a pyramid, and the pyramid ends up rocking back and forth instead of staying level.



The attach points are represented by an offset and direction normal, and I'm transforming the pyramid with a quaternion rotation from the up vector (the direction it naturally points) to the attach point's direction.

It works as expected when I rotate around the X or Z axes, but I'm guessing the Y axis causes issues because the from vector of the rotation is up.

Is there a different way I can do this rotation while maintaining the original orientation?

Adbot
ADBOT LOVES YOU

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
I lack the brain for helping with this right now, but your embed didn't work. People can click through on this link to view it though. Dunno what went wrong.

dizzywhip
Dec 23, 2005

Thanks, not sure what's wrong but it seems to be working on my end for some reason

TIP
Mar 21, 2006

Your move, creep.



dizzywhip posted:

Thanks, not sure what's wrong but it seems to be working on my end for some reason

you have to use url tags for videos, it's a weird quirk of the forums

I think it's working on your end because you already have the video cached or some such

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
If you have your pyramid pointing straight up, rotate it down 90 degrees (so that it's pointing straight out like the arm), rotate it around the Y axis by some amount, then rotate it back to pointing straight up - do you want it to maintain the original orientation of its faces?

If the answer is yes, then one of those movements will be a complex rotation, there's no way to avoid it. Try this yourself by playing around with your arms - hold your arms straight up, thumbs together. Then t-pose without moving your hands, so your thumbs are pointing up. Then point straight forwards with your arms, still with your thumbs pointing up. Then think about how your hands need to move to get back to their original position and thumbs-inward orientation.

If the answer is no, then you can't simply rotate the pyramid based on the direction of the attach point - you also need to track the orientation of the attach point as you transform it, because that orientation will be different depending on what path it took to get there.

dizzywhip
Dec 23, 2005

Thanks! That makes sense, but I'm not sure exactly how to put that into practice. For reference, this would be for things like attaching equipment to a character model, so if there's a sword or whatever in their hand, it should move naturally along with it. How is this sort of thing normally handled in a game engine?

Raenir Salazar
Nov 5, 2010

College Slice
Jesus I remember running into those problems and then some for my Live3D Kinect project; in some cases it was a problem of the multiplications of the rotations of the joins in the wrong order; consider adding debug lines to track their global and relative orientations of each joint and I think that should make it clearer what's going wrong.

dizzywhip
Dec 23, 2005

I think I got it after banging my head against the problem for a while. If I apply the joint animation transform directly to the attached object, then rotate from up to the untransformed direction of the attach point, everything seems to stay oriented properly.

Visualizing the rotation directly to the transformed attach point direction was helpful for realizing that I needed to orient the object to the attach point separately from animating it.

Thanks for the help! Here's the little man wiggling for your pleasure as a reward, hopefully embedded properly this time.

https://i.imgur.com/fAJolhz.mp4

Raenir Salazar
Nov 5, 2010

College Slice
Awesome! And yeah your solution sounds like something I had to do myself! :D

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Humble Bundle has some Blender books.

If I have some basic familiarity with Blender and a good grasp of Unity, do you expect I'd get some value out of that bundle if I want to do some 3d modeling and level design for personal projects? I figure it would be better to see steps statically on a page than having to wade through video at this point. They may not necessarily be current, but I've already figured from most videos that a lot of stuff doesn't change too much.

Raenir Salazar
Nov 5, 2010

College Slice
Holy poo poo does Unreals gesture/touch controls interface suck.

I had to recreate the rotate gesture event myself, it was so useless using Unreals, it kept going berserk and and flipping the axis for no reason with a totally normal movement. So it'd go from a 40d rotation to a -320d rotation as if I was suddenly rotating the other direction.

a grumpy lad
Aug 22, 2003

Long nights, impossible odds.
hi everyone I forgot how the forums work.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

a grumpy lad posted:

hi everyone I forgot how the forums work.

They don't, that's the secret

dizzywhip
Dec 23, 2005

Hello thread, back with another 3D math question. I'm still dealing with issues related to the orientation of attach points. My previous solution that used a single direction vector for each attach point ended up not actually working and would cause attached objects to distort in weird ways.

Now I'm trying a different approach where each attach point has an offset, a forward vector, and an up vector. When the base object is animated, I transform the offset and both vectors accordingly which produces the correct result.

The thing I'm having trouble with is deriving the transformation that will orient one attach point to another. The goal is to transform the attached object such that the offsets line up with each other, the forward vectors point toward each other, and the up vectors point in the same direction.

Here's some pseudocode for what I've come up with so far through trial and error, where a is the attach point on the base object and b is on the attached object:

code:
let upRotation      = Quaternion(from: b.up, to: a.up)

let forwardRotation = Quaternion(from: -b.forward, to: a.forward)

let fromTransform   = translation(a.offset) * upRotation * forwardRotation

let toTransform     = translation(b.offset)

return fromTransform * toTransform.inverse
This works perfectly in some cases, but other times the orientation will be off and the attached object will end up at the wrong angle. I think it starts breaking when the up vectors diverge too much.

Anyways, to boil down the problem, is it possible to derive a transformation matrix that rotates from one arbitrary set of forward and up vectors to another?

chglcu
May 17, 2007

I'm so bored with the USA.
I just woke up, so it’s way to early for math, especially quaternions, but I think you should be able to use the cross product of the two vectors to get your rotation axis and acos the dot product to get your rotation angle.

Xerophyte
Mar 17, 2008

This space intentionally left blank

dizzywhip posted:

Anyways, to boil down the problem, is it possible to derive a transformation matrix that rotates from one arbitrary set of forward and up vectors to another?

Yes. A 3x3 transform matrix just consists of the basis vectors in the rotated coordinate system, so given a set of basis vectors (you can obtain a full basis by crossing your up and forward vectors) and another set of basis vectors you absolutely can generate a matrix that transforms from one coordinate system to the other. You don't even need the basis vectors to be orthogonal, although you probably want them to be orthogonal unless you like introducing random shearing.

Call one system x, y, z, the other x', y', z'. One way to construct the transform is then to express x' y' z' using the xyz basis, then compound that matrix with the transform from xyz to your local cartesian. If you try to do that you'll find that the elements of the resulting matrix are just the 9 different dot products between the various basis vectors.

Whatever linear algebra/math library you're using should have a way of automatically computing such a matrix from the two bases. Good search terms are probably "change of basis" and "change of basis matrix".

Whether or not a matrix representation of the compound rotation will interpolate well enough for animation in whatever system you're working in, I have no idea.

dizzywhip
Dec 23, 2005

Thanks a lot for the help! I wasn’t familiar with change of basis as a concept so I took the evening to learn about it (this video helped a lot). It took a while to figure out exactly how to apply it to my particular use case, but I got it working and it ended up being pretty simple.

neurotech
Apr 22, 2004

Deep in my dreams and I still hear her callin'
If you're alone, I'll come home.

Over the past few days I've been trying to learn Unity so I can start making some simple games. Every time I open the IDE I find that I get really overwhelmed and rapidly lose the will to get stuck into things. Has anyone encountered this before? If so, how did you overcome it?

blastron
Dec 11, 2007

Don't doodle on it!


neurotech posted:

Over the past few days I've been trying to learn Unity so I can start making some simple games. Every time I open the IDE I find that I get really overwhelmed and rapidly lose the will to get stuck into things. Has anyone encountered this before? If so, how did you overcome it?

I get this all the time for a lot of different things, and my therapist thinks it’s a fun combination of anxiety and ADHD. What I recommend is figuring out a very small slice of something to work on, and to make it as manageable as possible to avoid being overwhelmed. Maybe find a tutorial on something basic and follow it along step by step?

neurotech
Apr 22, 2004

Deep in my dreams and I still hear her callin'
If you're alone, I'll come home.

blastron posted:

I get this all the time for a lot of different things, and my therapist thinks it’s a fun combination of anxiety and ADHD. What I recommend is figuring out a very small slice of something to work on, and to make it as manageable as possible to avoid being overwhelmed. Maybe find a tutorial on something basic and follow it along step by step?

That sounds similar to my situation. What is also compounding the problem is that Unity is quite out of my comfort zone (I'm much more comfortable in VS Code building stuff with TS/JS, React). I think I might try building a web-based game to make things less overwhelming on the developer experience side.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

neurotech posted:

That sounds similar to my situation. What is also compounding the problem is that Unity is quite out of my comfort zone (I'm much more comfortable in VS Code building stuff with TS/JS, React). I think I might try building a web-based game to make things less overwhelming on the developer experience side.
I recommend this. It also saves you the "unity version changed so you have to redo a bunch of stuff" pain, as typescript does a pretty good job of staying backwards-compatible. The downside is if you want to sell it the "release for various platforms in a downloadable way" aspect is a bit trickier.

neurotech
Apr 22, 2004

Deep in my dreams and I still hear her callin'
If you're alone, I'll come home.

roomforthetuna posted:

I recommend this. It also saves you the "unity version changed so you have to redo a bunch of stuff" pain, as typescript does a pretty good job of staying backwards-compatible. The downside is if you want to sell it the "release for various platforms in a downloadable way" aspect is a bit trickier.

This is just a weekend hobby/side project level venture at this point. I'm about 1-2 years away from even considering selling anything yet.

Alterian
Jan 28, 2003

Work through projects on learn.unity.com to get more familiar with how unity flows.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

neurotech posted:

Over the past few days I've been trying to learn Unity so I can start making some simple games. Every time I open the IDE I find that I get really overwhelmed and rapidly lose the will to get stuck into things. Has anyone encountered this before? If so, how did you overcome it?

Acknowledge that game development is something that will take years to become proficient in. Set small goals.

roomforthetuna posted:

I recommend this. It also saves you the "unity version changed so you have to redo a bunch of stuff" pain, as typescript does a pretty good job of staying backwards-compatible. The downside is if you want to sell it the "release for various platforms in a downloadable way" aspect is a bit trickier.

There's no reason to upgrade unity versions unless the one you're on is leaving LTS.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
Especially since this is just a hobby project, you should shop around and find the environment you find the most comfortable. No need to worry about shipping or selling, the goal is to enjoy the process as much as possible.

Beyond that, like blastron suggested, find a tutorial and follow it step by step. It is absolutely not feasible to try to learn a game engine by just poking around and experimenting on your own; there's way too much stuff.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

leper khan posted:

There's no reason to upgrade unity versions unless the one you're on is leaving LTS.
I made a couple of unity games some time ago; the existing web builds no longer work because back then Unity used a plugin, and I can't just build the same code for a new version. I have no reason to assume similar fuckery won't happen again. Conversely, I made some web-native games *more than twice as long ago* as I made the unity games, and they all still work fine.

(To be fair, unity now builds *to* web-native so the "binary" at least will probably keep working, but the ability to build it again on a new version is still gonna get future-hosed.)

Harminoff
Oct 24, 2005

👽

roomforthetuna posted:

I made a couple of unity games some time ago; the existing web builds no longer work because back then Unity used a plugin, and I can't just build the same code for a new version. I have no reason to assume similar fuckery won't happen again. Conversely, I made some web-native games *more than twice as long ago* as I made the unity games, and they all still work fine.

(To be fair, unity now builds *to* web-native so the "binary" at least will probably keep working, but the ability to build it again on a new version is still gonna get future-hosed.)

Not just a unity problem, same thing happened with godot and none of my old games work :(

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Harminoff posted:

Not just a unity problem, same thing happened with godot and none of my old games work :(
Yeah, Godot also got me, which is why I'm now firmly in a "just use raw code and no frameworks" mindset. Also I'm an old man of the Atari so that's more natural to me anyway.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
If you install some assets that shove some code in your project, do you .gitignore is so it doesn't show up in git? I kind of figured some of the new stuff Unity did (assembly definitions? Something newer) were a way of separating this stuff, but I have a bunch of stuff that still just vomits into the project. It does it under its own paths, so they're easy to mask off, but it's a chunk of junk if I throw it into my git project. I particularly care when it comes to binary resources that are included with them.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

If you install some assets that shove some code in your project, do you .gitignore is so it doesn't show up in git? I kind of figured some of the new stuff Unity did (assembly definitions? Something newer) were a way of separating this stuff, but I have a bunch of stuff that still just vomits into the project. It does it under its own paths, so they're easy to mask off, but it's a chunk of junk if I throw it into my git project. I particularly care when it comes to binary resources that are included with them.

If you have stuff you don't want in the project, .gitignore or .git/info/exclude

Hughlander
May 11, 2005

Rocko Bonaparte posted:

If you install some assets that shove some code in your project, do you .gitignore is so it doesn't show up in git? I kind of figured some of the new stuff Unity did (assembly definitions? Something newer) were a way of separating this stuff, but I have a bunch of stuff that still just vomits into the project. It does it under its own paths, so they're easy to mask off, but it's a chunk of junk if I throw it into my git project. I particularly care when it comes to binary resources that are included with them.

In Unity there's store asset packages and there's project registry packages. IE: Do they show up in Unity Registeries/My Registeries or My Assets? If it's an Asset Store Package then you need to check it into source control. You can move it as long as you adjust anything that looks for an absolute path which is almost nothing. IE: I put everything into Assets/3rd_party_assets/* If it's My Registery/Unity Registry, you don't need to check it into source control as it'll pull whenever you first open the project. You still *should* in my opinion though to avoid that step.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I think the Unity Registry is more of the ideal I was hoping for. What I got this time that had me posting was an asset store package, which was just more crap importing into the project. It was a level editor so I was wishing I could keep it out of the project whole screwing with it. I might not even keep it, so I didn't want to start fattening git up with it.

Hughlander
May 11, 2005

Rocko Bonaparte posted:

I think the Unity Registry is more of the ideal I was hoping for. What I got this time that had me posting was an asset store package, which was just more crap importing into the project. It was a level editor so I was wishing I could keep it out of the project whole screwing with it. I might not even keep it, so I didn't want to start fattening git up with it.

What you can also do is make a new project, import the asset into that project, delete anything you don't want, move it to a 3rd_party_assets folder etc... then export *THAT* folder to a new .unitypackage, and import *THAT* into your real project. I do these with massive low poly art bundles where I just want 2 models out of 200MB of assets.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Now that's clever.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
Editor extensions I have licensed for individual use but not for the whole org get imported then added to .git/info/exclude to keep them out of source control.

cpmaoa1990
Jul 21, 2023

by Fluffdaddy
I dunno if this is the thread for it, can I recruit here? Since it's the GDM, I thought it'd be ok to at least ask!

I'm looking for a team to make games with! I'm still learning to code, but I do art, development, music and more! I have the whole designs up and they'll be easy to produce! And we'll make millions on release because these will sell over 10m copies each! Games like Prey 2, Scalebound and Fortress I got the licenses to! So I can make my dreams happen! I have the whole projects done, and keep spoilers away! They'll be so enjoyable! But need the dev's to help!

What else are you making? Here's a tip: To increase your job happiness and workflow, start a demo level! Make it M1-0, Mission 1-0! Not released! In here, play it! Say you made FF7, they did the same! The tech guru cavern is where all their stuff was fun-programmed! This increases job survivability and ensures a project does get completed! Square's games do get released, UE dev's struggle to make ONE because they DON'T DO THIS! Make a demo level! They'll do art and code and play other games and Gears of War etc. all had so many other things created before they were released! We all know Game Dev Time - push to shove!

KillHour
Oct 28, 2007


What did I just read

cpmaoa1990
Jul 21, 2023

by Fluffdaddy

KillHour posted:

What did I just read

I dunno, do you make games?

Raenir Salazar
Nov 5, 2010

College Slice

cpmaoa1990 posted:

I dunno if this is the thread for it, can I recruit here? Since it's the GDM, I thought it'd be ok to at least ask!

I'm looking for a team to make games with! I'm still learning to code, but I do art, development, music and more! I have the whole designs up and they'll be easy to produce! And we'll make millions on release because these will sell over 10m copies each! Games like Prey 2, Scalebound and Fortress I got the licenses to! So I can make my dreams happen! I have the whole projects done, and keep spoilers away! They'll be so enjoyable! But need the dev's to help!

What else are you making? Here's a tip: To increase your job happiness and workflow, start a demo level! Make it M1-0, Mission 1-0! Not released! In here, play it! Say you made FF7, they did the same! The tech guru cavern is where all their stuff was fun-programmed! This increases job survivability and ensures a project does get completed! Square's games do get released, UE dev's struggle to make ONE because they DON'T DO THIS! Make a demo level! They'll do art and code and play other games and Gears of War etc. all had so many other things created before they were released! We all know Game Dev Time - push to shove!

I'm a little confused here because you seem to pivot from "Heya we're looking for programmers to join our team" to consultationspeak/unsolicited self-help advice that seems entirely disconnected from your initial pitch. Can you rephrase more specifically what you're looking for?

Adbot
ADBOT LOVES YOU

xzzy
Mar 5, 2009

There goes the exclamation point budget for the rest of the month.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply