This commit is contained in:
Nikita Kruglickiy
2023-05-22 19:06:26 +03:00
parent 345e60cf1d
commit 09be0ea795
35 changed files with 1423 additions and 336 deletions

View File

@@ -1,6 +1,6 @@
-- @shared
-- @name Audi A6 2012
-- @author DarkSupah
-- @author Opti1337, DarkSupah
-- @include /koptilnya/mesh_loader/builder.txt
require("/koptilnya/mesh_loader/builder.txt")
@@ -11,7 +11,31 @@ local SCALE = Vector(1)
local Materials =
{
Body = "phoenix_storms/fender_white",
Body = "models/debug/debugwhite",
Doors = {
basetexture = "https://i.imgur.com/VfIk2D6.png",
options = {
flags = 134219776,
color = Vector(0.7969166636467, 0.7969166636467, 0.73720490932465),
envmap = "env_cubemap",
envmaptint = Vector(0.069727085530758, 0.069727085530758, 0.069727085530758),
envmapsaturation = 0.69999998807907,
phong = 1,
phongexponent = 10.0,
}
},
BonnetLivery = {
basetexture = "https://i.imgur.com/MR4z42U.png",
options = {
flags = 0x0100,
baseLayout = {
x = 170,
y = 575,
w = 200,
h = 200
}
}
},
Shadow = "models/debug/debugwhite",
Grille = "models/shiny",
WindowsOutline = "models/debug/debugwhite",
@@ -89,68 +113,69 @@ local builder = {}
if SERVER then
builder = MeshBuilder:new(LINK)
local this = chip()
// Body group
builder:build("Body", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("Bonnet", Vector(0), Angle(0), SCALE + Vector(0.002), Color(255, 255, 255), Materials.BonnetLivery, this, this)
builder:build("Bonnet", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("Trunk", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("Doors", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("Doors", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Doors, this, this)
builder:build("FrontBumper", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("BodyMirrors", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("FrontShadows", Vector(0), Angle(0), SCALE, Colors.Shadow, Materials.Shadow, this, this)
builder:build("RearShadow", Vector(0), Angle(0), SCALE, Colors.Shadow, Materials.Shadow, this, this)
builder:build("Bottom", Vector(0), Angle(0), SCALE, Colors.Shadow, Materials.Shadow, this, this)
builder:build("GrillOutline", Vector(0), Angle(0), SCALE, Colors.Grille, Materials.Grille, this, this)
builder:build("WindowsOutline", Vector(0), Angle(0), SCALE, Colors.WindowsOutline, Materials.WindowsOutline, this, this)
// Badges and stuff
builder:build("Badge", Vector(0), Angle(0), SCALE, Colors.Badge, Materials.Badge, this, this)
builder:build("RearBadges", Vector(0), Angle(0), SCALE, Colors.Badge, Materials.Badge, this, this)
builder:build("ExhaustPipes", Vector(0), Angle(0), SCALE, Colors.ExhaustPipe, Materials.ExhaustPipe, this, this)
builder:build("ExhaustTips", Vector(0), Angle(0), SCALE, Colors.ExhaustTip, Materials.ExhaustTip, this, this)
// Rear lights
builder:build("RearLightsBase", Vector(0), Angle(0), SCALE, Colors.RearLightsBase, Materials.RearLightsBase, this, this)
local stopLights = builder:build("StopLights", Vector(0), Angle(0), SCALE, Colors.StopLights, Materials.StopLights, this, this)
stopLights:suppressEngineLighting(true)
local revLights = builder:build("ReverseLights", Vector(0), Angle(0), SCALE, Colors.ReverseLights, Materials.ReverseLights, this, this)
revLights:suppressEngineLighting(true)
revLights:suppressEngineLighting(true)
//builder:build("RearLightsGlass", Vector(0), Angle(0), SCALE, Colors.RearLightsGlass, Materials.RearLightsGlass, this, this)
// Front lights
builder:build("FrontLightsShadow", Vector(0), Angle(0), SCALE, Colors.FrontLightsBase, Materials.FrontLightsBase, this, this)
//builder:build("FrontLightsGlass", Vector(0), Angle(0), SCALE, Colors.FrontLightsGlass, Materials.FrontLightsGlass, this, this)
local frontLights = builder:build("FrontLights", Vector(0), Angle(0), SCALE, Colors.FrontLights, Materials.FrontLights, this, this)
frontLights:suppressEngineLighting(true)
// Interior
builder:build("Floor", Vector(0), Angle(0), SCALE, Colors.Floor, Materials.Floor, this, this)
builder:build("Dashboard", Vector(0), Angle(0), SCALE, Colors.Dashboard, Materials.Dashboard, this, this)
builder:build("TachoArrow", Vector(0), Angle(0), SCALE, Colors.Arrow, Materials.Arrow, this, this)
builder:build("SpeedArrow", Vector(0), Angle(0), SCALE, Colors.Arrow, Materials.Arrow, this, this)
builder:build("SteeringColumn", Vector(0), Angle(0), SCALE, Colors.SteeringColumn, Materials.SteeringColumn, this, this)
builder:build("InteriorChrome", Vector(0), Angle(0), SCALE, Colors.InteriorChrome, Materials.InteriorChrome, this, this)
builder:build("Interior", Vector(0), Angle(0), SCALE, Colors.Interior, Materials.Interior, this, this)
builder:build("DoorPanels", Vector(0), Angle(0), SCALE, Colors.DoorPanels, Materials.DoorPanels, this, this)
builder:build("DoorPanelsWood", Vector(0), Angle(0), SCALE, Colors.DoorPanelsLines, Materials.DoorPanelsLines, this, this)
builder:build("DoorHandles", Vector(0), Angle(0), SCALE, Colors.DoorHandles, Materials.DoorHandles, this, this)
builder:build("Seats", Vector(0), Angle(0), SCALE, Colors.Seats, Materials.Seats, this, this)
builder:build("RearSeats", Vector(0), Angle(0), SCALE, Colors.Seats, Materials.Seats, this, this)
builder:build("Torpedo", Vector(0), Angle(0), SCALE, Colors.Seats, Materials.Seats, this, this)
builder:build("ShifterOutline", Vector(0), Angle(0), SCALE, Colors.ShifterOutline, Materials.ShifterOutline, this, this)
builder:build("Mirrors", Vector(0), Angle(0), SCALE, Colors.Mirrors, Materials.Mirrors, this, this)
builder:build("ProfilesButtons", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("WindowControls", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
@@ -159,15 +184,15 @@ if SERVER then
builder:build("ShifterDecals", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("TopControls", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("Multimedia", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("Seatbelts", Vector(0), Angle(0), SCALE, Colors.Seatbelts, Materials.Seatbelts, this, this)
builder:build("SeatbeltsCaps", Vector(0), Angle(0), SCALE, Colors.SeatbeltsCaps, Materials.SeatbeltsCaps, this, this)
builder:build("SeatbeltsLocks", Vector(0), Angle(0), SCALE, Colors.SeatbeltsLocks, Materials.SeatbeltsLocks, this, this)
builder:build("RearSeatsChrome", Vector(0), Angle(0), SCALE, Colors.Interior, Materials.Interior, this, this)
builder:build("SeatbeltLockButtons", Vector(0), Angle(0), SCALE, Colors.SeatbeltLockButtons, Materials.SeatbeltLockButtons, this, this)
builder:build("DashDials", Vector(0), Angle(0), SCALE, Colors.DashDials, Materials.DashDials, this, this)
local result = builder:getResult()
else
PERMA.onPermissionsGained = function()

View File

@@ -0,0 +1,173 @@
-- @shared
-- @name BMW 850CSi 96
-- @author Opti1337, DarkSupah
-- @include /koptilnya/mesh_loader/builder.txt
--@include koptilnya/libs/flux.txt
local flux = require("koptilnya/libs/flux.txt")
require("/koptilnya/mesh_loader/builder.txt")
DEBUG_MODE = true
local LINK = "http://82.179.248.158/bmw_850csi_96.obj#baaz"
local SCALE = Vector(1)
local Materials =
{
--[[
Body = {
basetexture = "phoenix_storms/fender_white",
--bumpmap = "models/flat_normal",
options = {
flags = 134217728 + 2048,
--envmap = "env_cubemap",
--phong = 1,
--phongalbedotint = 1,
--phongboost = 6,
--phongexponent = 80,
--phongfresnelranges = Vector(1, 1, 1),
--halflambert = 1,
--envmapcontrast = 1,
--envmapsaturation = 0.7,
--envmaptint = Vector(0.3, 0.3, 0.3),
--test = Matrix()
}
},
]]
Body = "phoenix_storms/fender_white",
Shadow = "models/debug/debugwhite",
Chrome = "sprops/textures/sprops_chrome",
BlackPlastic = "models/debug/debugwhite",
Backface = "models/debug/debugwhite",
Under = "models/debug/debugwhite",
Mirror = "debug/env_cubemap_model",
Zeroblack = "models/debug/debugwhite"
}
local Colors =
{
Body = Color(230,230,255),
Shadow = Color(125,125,125),
Chrome = Color(255,255,255),
BlackPlastic = Color(25,25,25),
Backface = Color(25,25,25),
Under = Color(0,0,250),
Mirror = Color(255,255,250),
Zeroblack = Color(0,0,0)
}
local builder = {}
if SERVER then
builder = MeshBuilder:new(LINK)
local this = chip()
-- Body
local body = builder:build("body_a", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("hood_a", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("fenders_a", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("doorhandlelf", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("bumperf_a", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("bumperr_a", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("trunk_a", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("skirtl_e", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("wing_d", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("wingmirrors", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
-- Black plastic
builder:build("black_plastic", Vector(0), Angle(0), SCALE, Colors.BlackPlastic, Materials.BlackPlastic, this, this)
-- Chrome
builder:build("chrome", Vector(0), Angle(0), SCALE, Colors.Chrome, Materials.Chrome, this, this)
builder:build("exhaust_d", Vector(0), Angle(0), SCALE, Colors.Chrome, Materials.Chrome, this, this)
-- Other
builder:build("centerconsolebezels_symbols", Vector(0), Angle(0), SCALE, Colors.Shadow, "https://i.imgur.com/p61iQMu.png", this, this)
builder:build("gaugecluster_a", Vector(0), Angle(0), SCALE, Colors.Shadow, "https://i.imgur.com/VDRC1dz.png", this, this)
builder:build("bumperf_badge", Vector(0), Angle(0), SCALE, Color(255,255,255), "https://i.imgur.com/fCG0wsL.jpeg", this, this)
builder:build("trunk_badge", Vector(0), Angle(0), SCALE, Color(255,255,255), "https://i.imgur.com/fCG0wsL.jpeg", this, this)
builder:build("backface", Vector(0), Angle(0), SCALE, Colors.Backface, Materials.Backface, this, this)
builder:build("under", Vector(0), Angle(0), SCALE, Colors.Under, Materials.Under, this, this)
builder:build("mirror", Vector(0), Angle(0), SCALE, Colors.Mirror, Materials.Mirror, this, this)
builder:build("radiator", Vector(0), Angle(0), SCALE, Color(205,205,205), "phoenix_storms/dome", this, this)
builder:build("zeroblack", Vector(0), Angle(0), SCALE, Colors.Zeroblack, Materials.Zeroblack, this, this)
builder:build("dashpad_a", Vector(0), Angle(0), SCALE, Colors.Shadow, Materials.Shadow, this, this)
builder:build("doorcardlf_a", Vector(0), Angle(0), SCALE, Colors.Shadow, Materials.Shadow, this, this)
builder:build("floor_a", Vector(0), Angle(0), SCALE, Colors.Shadow, Materials.Shadow, this, this)
-- Headlights
local headlightRpos = Vector(-0.56101, -1.8125, 0.603)
local headlightRdir = headlightRpos - Vector(-0.48194, -1.8303, 0.60497)
local headlightRpivot = headlightRdir:getAngle()
local headlightR = holograms.create(this:localToWorld(headlightRpos * 39.37), this:localToWorldAngles(headlightRpivot), "models/holograms/cube.mdl")
headlightR:setNoDraw(true)
headlightR:setParent(this)
builder:build("headlightr", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, headlightR, this)
builder:build("headlightr_backface", Vector(0), Angle(0), SCALE, Colors.Backface, Materials.Backface, headlightR, this)
builder:build("headlightr_black_plastic", Vector(0), Angle(0), SCALE, Colors.BlackPlastic, Materials.BlackPlastic, headlightR, this)
builder:build("headlightr_chrome", Vector(0), Angle(0), SCALE, Colors.Chrome, Materials.Chrome, headlightR, this)
local headlightLpos = Vector(0.56101, -1.8125, 0.603)
local headlightLdir = Vector(0.48194, -1.8303, 0.60497) - headlightLpos
local headlightLpivot = headlightLdir:getAngle()
local headlightL = holograms.create(this:localToWorld(headlightLpos * 39.37), this:localToWorldAngles(headlightLpivot), "models/holograms/cube.mdl")
headlightL:setNoDraw(true)
headlightL:setParent(this)
builder:build("headlightl", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, headlightL, this)
builder:build("headlightl_backface", Vector(0), Angle(0), SCALE, Colors.Backface, Materials.Backface, headlightL, this)
builder:build("headlightl_black_plastic", Vector(0), Angle(0), SCALE, Colors.BlackPlastic, Materials.BlackPlastic, headlightL, this)
builder:build("headlightl_chrome", Vector(0), Angle(0), SCALE, Colors.Chrome, Materials.Chrome, headlightL, this)
local result = builder:getResult()
local headlightl = {
angle = 0
}
local headlightr = {
angle = 0
}
function openHeadlights()
flux.to(headlightl, 1, { angle = 28 }):delay(0.3):ease("quartout")
flux.to(headlightr, 1, { angle = 28 }):ease("quartout")
end
function closeHeadlights()
flux.to(headlightl, 0.8, { angle = 0 }):delay(0.3):ease("quartout")
flux.to(headlightr, 0.8, { angle = 0 }):ease("quartout")
end
hook.add("tick", "_tick", function()
flux.update(game.getTickInterval())
headlightR:setAngles(this:localToWorldAngles(headlightRpivot):rotateAroundAxis(headlightR:getForward(), headlightr.angle))
headlightL:setAngles(this:localToWorldAngles(headlightLpivot):rotateAroundAxis(headlightL:getForward(), headlightl.angle))
end)
wire.adjustPorts({State = "NUMBER"}, {})
hook.add("input", "_input", function(name, value)
if value > 0 then
openHeadlights()
else
closeHeadlights()
end
end)
else
PERMA.onPermissionsGained = function()
builder = MeshBuilder:new(LINK)
end
PERMA.build()
end

View File

@@ -38,11 +38,11 @@ if SERVER then
)
builder = MeshBuilder:new(LINK)
hook.add("input", "_input", function(name, value)
if name == "Wheels" then
builder:reset()
for _, wheel in pairs(wire.ports.Wheels) do
builder:build("center", Vector(0, OFFSET - 0.6, 0), Angle(0), SCALE, COLORS.Center, MATERIALS.Center, wheel, wheel)
builder:build("bolt", Vector(0, OFFSET- 0.6, 0), Angle(0), SCALE, COLORS.Bolt, MATERIALS.Bolt, wheel, wheel)
@@ -50,9 +50,19 @@ if SERVER then
builder:build("plastic", Vector(0, OFFSET, 0), Angle(0), SCALE, COLORS.Plastic, MATERIALS.Plastic, wheel, wheel)
builder:build("rim1", Vector(0, OFFSET, 0), Angle(0), SCALE - Vector(0, 0.1, 0), COLORS.RimAround, MATERIALS.Rim, wheel, wheel)
builder:build("rimAround", Vector(0, OFFSET, 0), Angle(0), SCALE - Vector(0, 0.1, 0), COLORS.Rim, MATERIALS.RimAround, wheel, wheel)
builder:build("tyre", Vector(0, OFFSET, 0), Angle(0), SCALE - Vector(0, 0.1, 0), Color(255, 255, 255), "sprops/textures/sprops_rubber", wheel, wheel)
builder:build("tyre", Vector(0, OFFSET, 0), Angle(0), SCALE - Vector(0, 0.1, 0), Color(255, 255, 255), {
basetexture = "phoenix_storms/car_tire",
bumpmap = "phoenix_storms/tire_bump",
options = {
envmap = "env_cubemap",
envmaptint = Vector(0.45345649123192, 0.45345649123192, 0.45345649123192),
flags = 138414080,
phong = 1,
phongexponent = 10.0
}
}, wheel, wheel)
end
builder:getResult()
end
end)
@@ -61,4 +71,4 @@ else
builder = MeshBuilder:new(LINK)
end
PERMA.build()
end
end

View File

@@ -6,7 +6,7 @@ require("/koptilnya/mesh_loader/builder.txt")
local LINK = "https://raw.githubusercontent.com/koptilnya/gmod-data/main/vaz2106.obj"
local SCALE = Vector(0.9)
local MATERIALS = {
Exterior = "phoenix_storms/mrref2",
Exterior = "models/debug/debugwhite",
Chrome = "models/shiny",
Plastic = "models/debug/debugwhite",
Glass = "phoenix_storms/mrref2",
@@ -67,9 +67,10 @@ local builder = {}
if SERVER then
builder = MeshBuilder:new(LINK)
builder:build("Body__Exterior", Vector(0), Angle(0), SCALE, COLORS.Exterior, MATERIALS.Exterior, chip(), chip())
--[[
builder:build("Body__WindowsLine__Rubber", Vector(0), Angle(0), SCALE, COLORS.Insulation, MATERIALS.Insulation, chip(), chip())
builder:build("Body__TrunkLine__Rubber", Vector(0), Angle(0), SCALE, COLORS.Insulation, MATERIALS.Insulation, chip(), chip())
@@ -78,7 +79,7 @@ if SERVER then
builder:build("Body__TrunkPinstripe__Chrome", Vector(0), Angle(0), SCALE, COLORS.Chrome, MATERIALS.Chrome, chip(), chip())
builder:build("Body__FuelCapLine__Chrome", Vector(0), Angle(0), SCALE, COLORS.Chrome, MATERIALS.Chrome, chip(), chip())
builder:build("Body__Under__Bottom", Vector(0), Angle(0), SCALE, COLORS.Under, MATERIALS.Under, chip(), chip())
builder:build("Body__Misc__Exterior", Vector(0), Angle(0), SCALE, COLORS.Exterior, MATERIALS.Exterior, chip(), chip())
builder:build("Interior__Seats__Seat", Vector(0), Angle(0), SCALE, COLORS.Seats, MATERIALS.Seats, chip(), chip())
@@ -152,9 +153,9 @@ if SERVER then
builder:build("RightRearDoor__Glass__Glass", Vector(0), Angle(0), SCALE, COLORS.Glass, MATERIALS.Glass, chip(), chip())
builder:build("RightRearDoor__Interior__DoorInterior", Vector(0), Angle(0), SCALE, COLORS.DoorInterior, MATERIALS.DoorInterior, chip(), chip())
builder:build("RightRearDoor__Handle__Chrome", Vector(0), Angle(0), SCALE, COLORS.DoorHandle, MATERIALS.DoorHandle, chip(), chip())
builder:build("Glass", Vector(0), Angle(0), SCALE, COLORS.Glass, MATERIALS.Glass, chip(), chip())
]]--
builder:getResult()
else
PERMA.onPermissionsGained = function()