Thanks bink ( porque escreve português ?? es brasileiro? ) But if you use waypoints you can create a spline to use in "path constrain"? And you right, with a camera i get a good point of view of track is very useful for my tests in point cloud
Point cloud is in max! maxScript i import the points from a XYZ file them use a mesh to store the points.
Hey bink i'm start using C# in MAXscript. I will try allocate points and slow functions like "Get the closest point"
First impressions: + Nice vector maths, good for learning! - Need to save AIW in rf2 devmode, if AIW is from rf1 got errors. - When drive in Fast the Camera is inverted. View attachment 8328 The error when import AIW from rf1 Code: -- Error occurred in readWpData(); filename: C:\Program Files (x86)\Autodesk\3ds Max 2010\Scripts\bink_aiCam1.ms; position: 11753; line: 159 -- Frame: -- frameAddFlg: false -- bitFields: undefined -- wp_branchID: 0 -- camMatrix: undefined -- aiCamTM: (matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]) -- maxPerp: [0,0,0] -- str: "1144" -- branchID: undefined -- modYaw: undefined -- wpseFlag: false -- CamPos: [0,0,0] -- modRoll: undefined -- numWp: 1 -- inString: "WP_PTRS=(1028,1143,1031,124)" -- bruce: StringStream:"" -- maxPos: [0,0,0] -- fOfs: 0.0 -- necessary: true -- nextWp: undefined -- workSS: StringStream:"number_waypoints=1144" -- camOri: [0,0,0] -- modPitch: undefined -- called in recordAIFile(); filename: C:\Program Files (x86)\Autodesk\3ds Max 2010\Scripts\bink_aiCam1.ms; position: 14561; line: 212 -- Frame: -- inFileName: "D:\rFactor2\ModDev\Locations\CircuitodaBoavista\Boavista2011\BOAVISTA2011.AIW" -- called in btnRec.pressed(); filename: C:\Program Files (x86)\Autodesk\3ds Max 2010\Scripts\bink_aiCam1.ms; position: 24010; line: 373 -- Frame: >> MAXScript Rollout Handler Exception: -- Unknown property: "row4" in undefined <<
About the inverted camera in fast drive if i do this.. Code: if branchID == 0 then -- if this is on the Main Path ( --old code modPitch = 90 + (radToDeg camOri.x) --adapt pitch modPitch =-( 90 + (radToDeg camOri.x) ) --adapt pitch --old code modYaw = 180 + (-(radToDeg camOri.z)) -- modify yaw .. notice y-z value swap modYaw = -(radToDeg camOri.z) -- modify yaw .. notice y-z value swap ) else -- must be a pit lane... STRANGELY, pitch and yaw are different in the pits ???? ( modPitch = -(90 + (radToDeg camOri.x)) -- adj pitch modYaw = -(radToDeg camOri.z) -- adj yaw ) if use the same for pit lane the camera is is well.
thanks fr the corrections and the information about the new AIW rf2. A good feature would be to create a camera from a spline (center track spline). When create a new track we don't have AIW file Maybe need a UPDATE button when change the spline or track. is Just a idea.
OK confirmed. Code: wp_pos=(-405.6186,11.21477,326.5066) wp_perp=(0.4856898,-0.002929318,0.8741262) wp_normal=(0.01507924,0.9998736,-0.005027749) wp_vect=(-4.937927,-0.08984375,2.768524) wp_width=(5.728,4.163,7.3844,5.8284) wp_dwidth=(7.3844,5.8284,0,0) wp_path=(-1.3046,0.0) wp_lockedAlpha=(0) wp_galpha=(0.09615707) wp_groove_lat=(0.000000) wp_test_speed=(-1.0) wp_score=(0,4.1132) wp_cheat=(-1.0) wp_pathabstractionspeed=(0.0000) wp_pathabstraction=(0,-1) wp_wpse=(0,0) wp_branchID=(0) wp_bitfields=(0) wp_lockedLats=(1) wp_multipathlat=(0.0, 0.0) wp_translat=(0.0000, 0.0000) wp_pitlane=(1) WP_PTRS=(960,1,-1,0) rf2 AIW (in AIW editor and press "find corridors" and save the file. Code: wp_pos=(-405.6186,11.3151,326.5066) wp_perp=(0.4944,0.0018,0.8692) wp_normal=(-0.0143,0.9999,0.0061) wp_pathinfo2=(0,-1.3046,-1.0000,-1.0000) wp_oriantation=(0,-0.0034,1.9510,-3.1256) wp_pathflags=(0,0) wp_pathinfo2=(1,0.0000,-1.0000,-1.0000) wp_oriantation=(1,-0.0091,2.0819,-3.1290) wp_pathflags=(1,0) wp_pathinfo2=(2,0.0000,-1.0000,-1.0000) wp_oriantation=(2,-0.0091,2.0819,-3.1290) wp_pathflags=(2,0) wp_width=(5.688,3.840,5.688,3.840) // road left, road right, far left, far right wp_dwidth=(5.688,3.840,0.000,0.000) // collision left, collision right, cut left, cut right wp_lockedAlpha=(0) // (used for editor specific algorithms) wp_test_speed=(-1.000000) wp_reverb=(0) wp_score=(0,2.766) // sector ID, distance into lap wp_wpse=(0,0) // some special events wp_branchID=(0) // 0 = main, 1...whatever pit lanes wp_bitfields=(0) // 1 = nonpath waypoint. wp_pitlane=(1) // what pitlane I'm a part of (only relevent for non-path waypoints) WP_PTRS=(960,1,-1,0) // prev waypoint id, next waypoint id, branch waypoint id, path of branch wp