Jump to content

Setting rotation of marker?


GTX

Recommended Posts

Posted

I looked @ editor resource for you and i found this:

you should look in editor_main>client>main

This isn't complete I know I had no time because I need to go

  
function updateArrowMarker( element ) 
    if not g_arrowMarker then return end 
  
    local element = element or g_selectedElement 
    if not element then return end 
  
    local radius = edf.edfGetElementRadius(element) or 1 
     
    local offsetZ = radius + 1 
    local markerSize = math.max(g_arrowMarkerMinSize,g_arrowMarkerSizeRatio*radius) 
     
    if isElementAttached(g_arrowMarker) then 
        detachElements(g_arrowMarker, getElementAttachedTo(g_arrowMarker)) 
    end 
    setMarkerSize(g_arrowMarker, markerSize) 
    attachElements(g_arrowMarker, element, 0, 0, offsetZ) 
    showGridlines ( element ) 
end 
  
function createArrowMarker( handle ) 
    if not handle or not isElement(handle) then return end 
  
    if g_arrowMarker then destroyElement(g_arrowMarker) end 
  
    g_arrowMarker = createMarker(0, 0, 0, "arrow", .5, 255, 255, 0, 255) 
    setElementDimension(g_arrowMarker, getWorkingDimension()) 
    updateArrowMarker( handle ) 
end 

you should look in editor_main>client>main

Posted

@denny199 I want to set a rotation of a cylinder. Tried that code and it really doesn't set rotation of a cylinder.

Weird... I tried setElementPosition and it works... but setElementRotation doesn't...

Posted

Cylinders can only be placed in a "standing" positon, thus there is no way to rotate it on X and Y axis.

And rotating it on Z makes no sense because of its circular shape.

  • 10 years later...
Posted

try this:

local x,y,z = 0,0,0
local radius = 2
local rx,ry,rz = 0,90,90
local markerRL2 = createObject(1316,x,y,z)
setObjectScale(markerRL2,radius)
setElementRotation(markerRL2,rx,ry,rz)
createColSphere(x,y,z,radius+0.2)

this will make a marker like "ring":

Learning to Fly - GTA: San Andreas Wiki Guide - IGN

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