Jump to content

Recommended Posts

Hello,

I want to "mirror" the 3D model of the player / actor in the inventory in order to get a preview of the equipment directly in the inventory like in modern video games.

For example

ZtWD1ba.png

 

I can do this using Python or I have to write C++ code? Which module I have to call to render the 3D model?

Thanks.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/18390-mirror-player-in-the-inventory/
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 4 weeks later...
  • Management
On 4/4/2018 at 4:29 PM, Basileus said:

Hello,

I want to "mirror" the 3D model of the player / actor in the inventory in order to get a preview of the equipment directly in the inventory like in modern video games.

For example

ZtWD1ba.png

 

I can do this using Python or I have to write C++ code? Which module I have to call to render the 3D model?

Thanks.

On introselect.py you have something like this code to render the character:

	class CharacterRenderer(ui.Window):
		def OnRender(self):
			grp.ClearDepthBuffer()

			grp.SetGameRenderState()
			grp.PushState()
			grp.SetOmniLight()

			screenWidth = wndMgr.GetScreenWidth()
			screenHeight = wndMgr.GetScreenHeight()
			newScreenWidth = float(screenWidth+30)
			newScreenHeight = float(screenHeight+30)
			
			grp.SetViewport(270.0/screenWidth, 0.0, newScreenWidth/screenWidth, newScreenHeight/screenHeight)

			app.SetCenterPosition(5.0, 350.0, 20.0)
			app.SetCamera(800.0, 15.0, 195.0, 205.0)
			grp.SetPerspective(16.0, newScreenWidth/newScreenHeight, 1000.0, 4000.0)

			(x, y) = app.GetCursorPosition()
			grp.SetCursorPosition(x, y)

			chr.Deform()
			chr.Render()

			grp.RestoreViewport()
			grp.PopState()
			grp.SetInterfaceRenderState()

Maybe you also have to edit something on source to load that function and add weapon on uiinventory.py, like I said, I don't know, but doesn't sound something that is very very hard, since almost every function is already made...

Edited by Metin2 Dev
Core X - External 2 Internal

raw

raw

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.