Jump to content

Recommended Posts

4 hours ago, Finnael said:

You mean like zooming or rotating the object?

Yes exactly, Some monsters are large and you need a zoom out to make a good preview. Rotating i think the preview model is rotating by itself so it's not that necessary..

It is not really that hard to do actually. Inside CRenderTarget.cpp there is a function called RenderModel. And inside that function there is this call:

camera_manager.GetCurrentCamera()->SetViewParams(
        D3DXVECTOR3{ 0.0f, -1500.0f, 600.0f },
        D3DXVECTOR3{ 0.0f, 0.0f, 95.0f },
        D3DXVECTOR3{0.0f, 0.0f, 1.0f}
    );

 

The first parameter here is the position of our camera that looks at the target. Second paremeter is the position of our target. The third parameter here is not important for us. (Though it should be always D3DXVECTOR3{0.0f, 0.0f, 1.0f} otherwise we might get weird errors.)

 

So if you want to zoom out you need to either change the position of the camera or the target. What can you do is have a member variable inside CRenderTarget class. Something like this :

D3DXVECTOR3 m_cameraPosition;

Initialize this variable inside CRenderTarget constructor like this:

m_cameraPosition = D3DXVECTOR3{ 0.0f, -1500.0f, 600.0f };

And change the above code to this:

 camera_manager.GetCurrentCamera()->SetViewParams(
        m_cameraPosition,
        D3DXVECTOR3{ 0.0f, 0.0f, 95.0f },
        D3DXVECTOR3{0.0f, 0.0f, 1.0f}
    );

 

Now when you change the m_cameraPosition to whatever value you want the camera position will be changed instantly.

  • Love 3
4 hours ago, Finnael said:

It is not really that hard to do actually. Inside CRenderTarget.cpp there is a function called RenderModel. And inside that function there is this call:

 


camera_manager.GetCurrentCamera()->SetViewParams(
        D3DXVECTOR3{ 0.0f, -1500.0f, 600.0f },
        D3DXVECTOR3{ 0.0f, 0.0f, 95.0f },
        D3DXVECTOR3{0.0f, 0.0f, 1.0f}
    );

 

 

The first parameter here is the position of our camera that looks at the target. Second paremeter is the position of our target. The third parameter here is not important for us. (Though it should be always D3DXVECTOR3{0.0f, 0.0f, 1.0f} otherwise we might get weird errors.)

 

So if you want to zoom out you need to either change the position of the camera or the target. What can you do is have a member variable inside CRenderTarget class. Something like this :

 


D3DXVECTOR3 m_cameraPosition;

Initialize this variable inside CRenderTarget constructor like this:

 


m_cameraPosition = D3DXVECTOR3{ 0.0f, -1500.0f, 600.0f };

 

And change the above code to this:

 


 camera_manager.GetCurrentCamera()->SetViewParams(
        m_cameraPosition,
        D3DXVECTOR3{ 0.0f, 0.0f, 95.0f },
        D3DXVECTOR3{0.0f, 0.0f, 1.0f}
    );

 

 

Now when you change the m_cameraPosition to whatever value you want the camera position will be changed instantly.

You know i actually did not think this through, Thanks for the idea :D
I managed to do it but also bind it to the model index. So that i can get the best camera for each monster.
Thanks again?
 

1 hour ago, נσναnz said:

You know i actually did not think this through, Thanks for the idea :D
I managed to do it but also bind it to the model index. So that i can get the best camera for each monster.
Thanks again?
 

Glad, I could help.

Hey @V0lvox could You help me with this or anyone else? (Syserr.txt from client)
 

0815 17:18:24597 :: Traceback (most recent call last):

0815 17:18:24597 ::   File "ui.py", line 1589, in OnOverInItem

0815 17:18:24597 ::   File "ui.py", line 87, in __call__

0815 17:18:24597 ::   File "ui.py", line 78, in __call__

0815 17:18:24598 ::   File "uiInventory.py", line 1199, in OverInItem

0815 17:18:24598 ::   File "uiInventory.py", line 1375, in ShowToolTip

0815 17:18:24598 ::   File "uiToolTip.py", line 590, in SetInventoryItem

0815 17:18:24598 ::   File "uiToolTip.py", line 1011, in AddItemData

0815 17:18:24598 ::   File "uiToolTip.py", line 1538, in __ModelPreview

0815 17:18:24598 :: AttributeError
0815 17:18:24598 :: : 
0815 17:18:24598 :: 'module' object has no attribute 'RenderTarget'
0815 17:18:24598 :: 

0815 17:18:24793 :: Traceback (most recent call last):

0815 17:18:24793 ::   File "ui.py", line 1589, in OnOverInItem

0815 17:18:24793 ::   File "ui.py", line 87, in __call__

0815 17:18:24793 ::   File "ui.py", line 78, in __call__

0815 17:18:24793 ::   File "uiInventory.py", line 1199, in OverInItem

0815 17:18:24794 ::   File "uiInventory.py", line 1375, in ShowToolTip

0815 17:18:24794 ::   File "uiToolTip.py", line 590, in SetInventoryItem

0815 17:18:24794 ::   File "uiToolTip.py", line 976, in AddItemData

0815 17:18:24794 ::   File "uiToolTip.py", line 1574, in __ModelPreviewClose

0815 17:18:24794 :: AttributeError
0815 17:18:24794 :: : 
0815 17:18:24794 :: 'NoneType' object has no attribute 'Hide'
0815 17:18:24794 :: 

 

Problem solved, i missed that part from ui.py:

 

class RenderTarget(Window):

	def __init__(self, layer = "UI"):
		Window.__init__(self, layer)
		
		self.number = -1

	def __del__(self):
		Window.__del__(self)

	def RegisterWindow(self, layer):
		self.hWnd = wndMgr.RegisterRenderTarget(self, layer)
		
	def SetRenderTarget(self, number):
		self.number = number
		wndMgr.SetRenderTarget(self.hWnd, self.number)

Everything is working :)

  • Love 1

Sura Enchanted Blade Skill Problem

 

Skill off: https://metin2.download/picture/Vhkc63uvwbv81VyeibLa9883n307mrZ5/.gif

Skill on: https://metin2.download/picture/ADeFvJq66ipYWB9Y9St6Ojdm7fL9ut0W/.gif

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 5
  • Sad 1
  • Good 2
7 hours ago, MEKA said:

Send us your uitooltip.py.

Edited by Metin2 Dev
Core X - External 2 Internal
On 8/18/2020 at 8:39 PM, MEKA said:

https://paste2.org/akMHpaMv

The render target is reset when the sp potion is open

 

@FinnaelHey will you help ?

@VegaS™ do you have any idea about this topic ?

 

 

Edited by MEKA
  • 2 weeks later...
  • 1 month later...

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.