Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2020-04-30, 16:16


readreis







Wiek: 37
Na forum: 4049 dni
Posty: 62

Piwa: 4

Respekt: 50

witam, robie wybor spawnu i chce zrobic aby po najechaniu na dany spawn kamera pokazala na to miejsce no i to dziala tylko ze jest chwilowy lag przy zmianie kamery
    if isMouseIn(screenW * -0.0016, screenH * 0.0600, screenW * 0.2573, screenH * 0.1083) then 
        setCameraMatrix(-1540.98, 890.80, 40.52, -1497.62, 919.83, 7.19)
        dxDrawImage(screenW * -0.0016, screenH * 0.0600, screenW * 0.2573, screenH * 0.1083, "xxxxxxxxxxxx", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    else
        setCameraMatrix(x,y,100.72,-2021.68, 175.80, 28.80)
    end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-30, 18:53


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

setCameraMatrix w evencie onClientRender? Ciekawe posuni?cie...

Wyci?gnij go z tego i zobacz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-30, 23:33


readreis







Wiek: 37
Na forum: 4049 dni
Posty: 62

Piwa: 4

Respekt: 50

co to ma do rzeczy, moglbys rozwinac swoja wypowiedz? przenioslem to z tego i teraz to nie dziala ;c

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-30, 23:38


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3950 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2322

Respekt: 240
Respekt: 240Respekt: 240

readreis, dzieje si? tak, poniewa? gra ?aduje modele z obszaru do kt?rego przechodzi kamera, funkcjami MTA raczej nie da si? nic z tym zrobi?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-30, 23:53


readreis







Wiek: 37
Na forum: 4049 dni
Posty: 62

Piwa: 4

Respekt: 50

Pawel5321, myslalem ze dam rade to zrobic bo widzialem wlasnie na serwerze 4life takie plynne przejscie ale pewnie to nie na moj poziom zaawansowania skryt myslalem ze smootCameraMove cos zadzialam ale nie wyszlo

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-03, 00:12


Avenged

Młodszy Szkrypter






Wiek: 24
Na forum: 3651 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1572

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Do p?ynnego przej?cia kamery mo?esz u?y? mi?dzy innymi:

Więcej informacji znajdziesz w Wikipedii MTA:

interpolateBetween


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-03, 02:51


readreis







Wiek: 37
Na forum: 4049 dni
Posty: 62

Piwa: 4

Respekt: 50

"Avenged" napisał/a:

Do p?ynnego przej?cia kamery mo?esz u?y? mi?dzy innymi:

Więcej informacji znajdziesz w Wikipedii MTA:

interpolateBetween


Dobra uda?o si?, lecz tam gdzie poleci kamera nie ma wyrenderowanej mapki ;/

[ Dodano: 2020-05-03, 03:57 ]
Troche pozmianialem wszystko dziala tak jak chcialem ale wyskakuje warning w debugu
Kod:

'addEventHandler' ['onClientPreRender' with this function is already handled]


leci = false
leci2 = false 
leci3 = false 
 
 
function interpolateCam()
    local now = getTickCount()
    local endTime = start + 2000
    local elapsedTime = now - start
    local duration = endTime - start
    local progress = elapsedTime / duration
    local px, py, pz = getElementPosition(localPlayer)
    local x, y, z = interpolateBetween ( dx, dy, dz, -1524.50, 890.68, 28.31, progress, "OutQuad")
    setCameraMatrix(x, y, z, -1502.29, 919.74, 7.19+0.6, 0, 0)
end

function interpolateCam2()
    local now = getTickCount()
    local endTime = start2 + 2000
    local elapsedTime = now - start2
    local duration = endTime - start2
    local progress = elapsedTime / duration
    local px, py, pz = getElementPosition(localPlayer)
    local x, y, z = interpolateBetween ( dx, dy, dz, -1704.22, 917.29, 58.05, progress, "OutQuad")
    setCameraMatrix(x, y, z, -1748.76, 949.68, 24.74+0.6, 0, 0)
end

function interpolateCam3()
    local now = getTickCount()
    local endTime = start3 + 2000
    local elapsedTime = now - start3
    local duration = endTime - start3
    local progress = elapsedTime / duration
    local px, py, pz = getElementPosition(localPlayer)
    local x, y, z = interpolateBetween ( dx, dy, dz, -2011.35, 1103.20, 95.72, progress, "OutQuad")
    setCameraMatrix(x, y, z, -1995.07, 1045.37, 55.72+0.6, 0, 0)
end

function renderZoneBox()
    if data.info then dxDrawText(data.info, sx*252/1024, sy*232/768, sx*800/1024, sy*255/768, tocolor(255, 0, 0, 255), 1.00, "default", "center", "center", false) end
        f1 = f12

        local x,y=getPointFromDistanceRotation(-2021.68, 175.80, dist, angler)
        angler=(angler+0.1)

    if leci == true then
        addEventHandler("onClientPreRender", root, interpolateCam) ---- tutaj warning
    else
        leci = false
        removeEventHandler("onClientPreRender", root, interpolateCam)
        start = nil
    end

    
    if leci2 == true then
        addEventHandler("onClientPreRender", root, interpolateCam2) ---- tutaj warning
    else
        removeEventHandler("onClientPreRender", root, interpolateCam2)
        leci2 = false
        start2 = nil
    end

    
    if leci3 == true then
        addEventHandler("onClientPreRender", root, interpolateCam3) ---- tutaj warning
    else
        removeEventHandler("onClientPreRender", root, interpolateCam3)
        leci3 = false
        start3 = nil
    end

    if isMouseIn(screenW * -0.0016, screenH * 0.0600, screenW * 0.2573, screenH * 0.1083) then
        start = getTickCount()
        dx, dy, dz, lx, ly, lz = getCameraMatrix()
        leci = true
        leci2 = false 
        leci3 = false
        dxDrawImage(wysun, screenH * 0.0600, screenW * 0.2573, screenH * 0.1083, "xxxxx.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    else
        dxDrawImage(wysun, screenH * 0.0600, screenW * 0.2573, screenH * 0.1083, "xxxxx.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    end
    if isMouseIn(screenW * -0.0016, screenH * 0.2000, screenW * 0.2573, screenH * 0.1083) then
        start2 = getTickCount()
        dx, dy, dz, lx, ly, lz = getCameraMatrix()
        leci = false
        leci3 = false 
        leci2 = true
        dxDrawImage(wysun2, screenH * 0.2000, screenW * 0.2573, screenH * 0.1083, "xxxxx.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    else
        dxDrawImage(wysun2, screenH * 0.2000, screenW * 0.2573, screenH * 0.1083, "xxxxx.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    end
    if isMouseIn(screenW * -0.0016, screenH * 0.3400, screenW * 0.2573, screenH * 0.1083) then
        start3 = getTickCount()
        dx, dy, dz, lx, ly, lz = getCameraMatrix()
        leci = false
        leci3 = true 
        leci2 = false
        dxDrawImage(wysun3, screenH * 0.3400, screenW * 0.2573, screenH * 0.1083, "xxxxx.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    else
        dxDrawImage(wysun3, screenH * 0.3400, screenW * 0.2573, screenH * 0.1083, "xxxxxxx.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    end


prosze nie smiac sie z tego kodu :) wiem ze jest slabo napisany staram sie

[ Dodano: 2020-05-03, 23:07 ]
halo pomocy

Postaw piwo autorowi tego posta
 

 
Tagi: plynne :: przejscie :: setcameramatrix
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » plynne przejscie setcameramatrix Odpowiedz do tematu

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku