Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOV causing out of sync cursor #36

Closed
0wain opened this issue Nov 9, 2021 · 3 comments
Closed

FOV causing out of sync cursor #36

0wain opened this issue Nov 9, 2021 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@0wain
Copy link

0wain commented Nov 9, 2021

Hey.

I'm working on some 3D2D stuff on a ViewModel, and I found that the FOV makes the cursor fall out of sync with the UI. I looked at #9, which seems to share my issue, but I'm not too keen on his solution. Is there anything else I can do to get around this? It could be that I just have a monkey brain and am missing something really obvious.

A video example.

A code snippet:

function SWEP:PostDrawViewModel(entity, weapon, ply)
	if imgui.Entity3D2D(entity, Vector(9.99, 3.36, 2.17), Angle(0, -90, 89), 0.01) then
		draw.RoundedBox(0, 0, 0, 100, 100, color_white)
		imgui.xCursor(0, 0, 612, 396)
	imgui.End3D2D() end
end

Any help on this would be amazing.

@0wain
Copy link
Author

0wain commented Nov 9, 2021

It's also worth noting that I have already attempted to set the position and angle manually using imgui.Start3D2D, but had received the same issue.

@0wain
Copy link
Author

0wain commented Nov 9, 2021

Just noticed that this is a duplicate issue of #35.

@0wain 0wain closed this as completed Nov 9, 2021
@wyozi wyozi added the duplicate This issue or pull request already exists label Nov 9, 2021
@wyozi
Copy link
Contributor

wyozi commented Nov 9, 2021

Yep, seems like viewmodel position mapping could really use some custom logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants