# Cinema - problem x,y,z

## Recommended Posts

Hi there, how do to watch movies in their place (x, y, z) of the object (16000)?

It is set object at Fort Carson, and I made my interior and how to move the x, y, z?

The script is:

https://community.multitheftauto.com/in ... s&id=11851

#### Share this post

##### Link to post

line 61-64 in client

```function webBrowserRender()
local x, y = 110.7, 1024.15 <--- Set to location you want, very right of screen I'm assuming.
dxDrawMaterialLine3D(x, y, TopZ, x, y, BottomZ,webBrowser, 18.2, tocolor(255, 255, 255, 255), x, y+1, 19)
end
```

#### Share this post

##### Link to post
```
function webBrowserRender()
local x, y = 110.7, 1024.15 <--- Set to location you want, very right of screen I'm assuming.
dxDrawMaterialLine3D(x, y, TopZ, x, y, BottomZ,webBrowser, 18.2, tocolor(255, 255, 255, 255), x, y+1, 19)
end

```

There is only X and Y position my screen has x, y, z, and where now enter a "z"?

Screen:

Just add "z"?

```
function webBrowserRender()
local x, y, z = 1069.2900390625, -1110.424804875, 1995
dxDrawMaterialLine3D(x, y, z, TopZ, x, y, BottomZ,webBrowser, 18.2, tocolor(255, 255, 255, 255), x, y+1, z, 19)
end

```

And so I do not work..

#### Share this post

##### Link to post
```BottomZ == Put the number you want for bottom Z
```

```TopZ ==  Put number you want for top Z
```

#### Share this post

##### Link to post

Or better yet, simply do this and it will be automatic;

```function getPositionFromElementOffset(element, offX, offY, offZ)
local m = getElementMatrix(element)
local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1]
local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2]
local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3]
return x, y, z
end

function webBrowserRender()
-- This will fetch the top middle point of the drive-in screen (Remember to replace the INSERTSCREENELEMENTHERE variable with your object pointer)
local screenPosX, screenPosY, screenPosZ = getPositionFromElementOffset(INSERTSCREENELEMENTHERE, 0, 0.04, 10.6)
dxDrawMaterialLine3D(screenPosX, screenPosY, screenPosZ, screenPosX, screenPosY, screenPosZ-8.5, webBrowser, 18, tocolor(255, 255, 255, 255), screenPosX, screenPosY+1, screenPosZ)
end
```

This way you can put the screen object pretty much wherever you please as the position is relative to the object and not worldspace. You can also easily adapt this for more than 1 screen if you so desire.

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

## Sign in

Already have an account? Sign in here.

Sign In Now

• ### Recently Browsing   0 members

No registered users viewing this page.