Jump to content

Render Target Remastered


Recommended Posts

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
Link to comment
Share on other sites

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?
 

Link to comment
Share on other sites

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 :: 

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

7 hours ago, MEKA said:

Send us your uitooltip.py.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Announcements



  • Similar Content

  • Similar Content

  • Similar Content

  • Tags

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.