DxDrawModel3D: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Fix the function's name in syntax)
Line 13: Line 13:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool dxDrawModel( int modelId, float positionX, float positionY, float positionZ, float rotationX, float rotationY, float rotationZ [, float scaleX, float scaleY, float scaleZ ])
bool dxDrawModel3D( int modelId, float positionX, float positionY, float positionZ, float rotationX, float rotationY, float rotationZ [, float scaleX, float scaleY, float scaleZ ])
</syntaxhighlight>
</syntaxhighlight>



Revision as of 22:09, 25 July 2024

[[{{{image}}}|link=|]] Important Note: You can not use this function to draw vehicles and ped
[[{{{image}}}|link=|]] Important Note: This function doesn't obey any streaming limits, you can draw as many models as you want
[[{{{image}}}|link=|]] Important Note: You can not render model to render target.
ADDED/UPDATED IN VERSION 1.6.0 r22271:

This function draws a 3D model - rendered for one frame. Drawn models are indistinguishable from this one created by createObject function. This should be used in conjunction with onClientRender in order to display continuously.


Dialog-warning.png Function has been disabled.

Reason/Note: Feature temporarily removed in 22272 due to feedback - Bugtracker Issue: #3212


Syntax

bool dxDrawModel3D( int modelId, float positionX, float positionY, float positionZ, float rotationX, float rotationY, float rotationZ [, float scaleX, float scaleY, float scaleZ ])
Model during day
Model during night

Required Arguments

  • modelId: Model you want to draw, must be regular object, you can not draw vehicles and peds
  • positionX/Y/Z: Position of model
  • rotationX/Y/Z: Rotation of model

Optional Arguments

  • scaleX/Y/Z: Scale of model, by default {1,1,1}

Returns

Returns true if the operation was successful, false otherwise.





Example

Click to collapse [-]
Client

Simple example

addEventHandler("onClientPreRender", root, function()
    dxDrawModel3D(3276, -719.64984, 951.26685, 12.13281, 0, 0,90)
end)

See Also