Jump to content

Image


developa

Recommended Posts

Posted (edited)

@Mr.Loki

How to create 3d image with get screen from world position,  but with the same image size,  even if i am away from that position. 
100 dist from image = size=200

I want to do it so:
200 dist from image = The same sizes of image as on 100 dist

Image is always as big as i want even if i am much distance from that position
How to do???

My code, Here the picture increases with respect to distance, and I want to do as I described above.

local element = createVehicle(411, 0, 0, 0)

addEventHandler("onClientRender", root, function()
	local playerPosition = {getElementPosition(localPlayer)}
	local elementPosition = {getElementPosition(element)}
	local distance = math.floor(getDistanceBetweenPoints3D(elementPosition[1], elementPosition[2], elementPosition[3], playerPosition[1], playerPosition[2], playerPosition[3]))
	local coords = {getScreenFromWorldPosition(elementPosition[1], elementPosition[2], elementPosition[3]+0.3)}
	local clear = isLineOfSightClear(elementPosition[1], elementPosition[2], elementPosition[3], playerPosition[1], playerPosition[2], playerPosition[3], false, false, false, false, true, false, false, nil)
	
	if coords[1] and clear then
		dxDrawText(distance.."m", coords[1], coords[2], coords[1], coords[2], tocolor(255, 255, 255, 255), 2, "default-bold", "center", "center", false, false)
		dxDrawImage(coords[1], coords[2], 64, 64, "asd.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
	end
end)

Help, please :(

Edited by developa
Posted (edited)

Not working, The point is that this image has the same size regardless of distance, not to increase XDDDDD

Edited by developa
  • Moderators
Posted

De-increase, not increase. Which should happen when you move away.

 

Check the screenshots.

Image1

Image2

Image3

Image4

 

If this is not what you want, then you should rewrite the concept so I can understand what you want.

 

 

Posted
20 minutes ago, IIYAMA said:

De-increase, not increase. Which should happen when you move away.

 

Check the screenshots.

Image1

Image2

Image3

Image4

 

If this is not what you want, then you should rewrite the concept so I can understand what you want.

 

 

He want's the image to keep the size when the player move as if the image is somehow tied to the player.

  • Moderators
Posted
54 minutes ago, developa said:

 

I want to see the SAME SIZE from any DISTANCE!

:arrowdown:

Then do not scale it.

:arrowdown:

But keep it the same size...

 

If you are not satisfied with my help, then please ask somebody else to help you with this.

 

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.
×
×
  • Create New...