libsm64 / libsm64-blender

Blender client for libsm64
569 stars 22 forks source link

Viewport is centered below Mario's feet, which makes it hard to see where you are going. #27

Closed JamesO2x closed 2 years ago

JamesO2x commented 2 years ago

Title says it all, really. When the "Follow Mario with 3D Cursor + Camera" option is toggled on, the view is pointed exactly at Mario's origin (right below his feet). This makes it hard to see anything if the view is zoomed in at all.

I understand that Mario's origin is below his feet, as this is how Mario 64 is programmed. And I understand that the 3D Cursor just snaps to his origin, and the Blender viewport is then centered on that 3D cursor.

Relevant image:

Can't See

But would it be possible to either place the 3D cursor above his head during play, or even just offset the Z-location of the viewport center from the 3D cursor?

I suggest that the viewport should be placed above Mario's head and not just centered at his body. If the viewport is looking at a point above Mario's head, then Mario's model won't ever be obstructing our view. And if you zoom in all the way you could have a sort of "First Person" mode.

Here's some images that show where I would suggest the 3D cursor/viewport camera be centered in relation to Mario.

You can see here that even if you zoom in very far, you can still see where you are going: Suggestion Zoomed


Alternatively, having a new option to offset the view would be nice. Here's a suggestion of how I would modify the panel to do this:

Panel

I guess the X and Y slider's aren't that important, mainly just the Z one. But I just mocked up all 3 as an example of how it could look.

jaburns commented 2 years ago

Yeah the view center offset is a good idea, and it wouldn't be too hard to implement. Thanks for the comprehensive ticket.

JamesO2x commented 2 years ago

No problem. Thanks for this cool addon, I've been addicted to playing with it for a few days now, haha.

JamesO2x commented 2 years ago

I'm new to Python, but I thought I'd try to address this one myself. I got it working with a single Float Property, but I wasn't able to fully figure out how to pass an XYZ vector into the script.

This is my first ever commit to another project, and also my first attempt at a Blender addon. So let me know if I've done anything wrong.

Here's a screenshot of my code working. You can adjust how far from Mario's Origin the 3D Cursor is, and it follows him properly.

Imgur

jaburns commented 2 years ago

Thanks for the fix!