Vida Marcell Posted December 9, 2021 Share Posted December 9, 2021 Hi everyone, im planning a software similar to Naturalmotion morpheme, so the main point is to make creating 3d peoples easyer. now i will need a 3d viewport, and a flowgraph, here is the example: videoplayback.mp4 So the only question is, how can i use the leadwerks flowgraph in my software i will use leadwerks and uak. Quote Link to comment Share on other sites More sharing options...
Vida Marcell Posted December 9, 2021 Author Share Posted December 9, 2021 Also backstory, some mobile game makers brought this middleware. maybe is im going to be more experienced, i will make a software like this, but it will require mocap and other various **** Quote Link to comment Share on other sites More sharing options...
Josh Posted December 9, 2021 Share Posted December 9, 2021 The flowgraph code is part of the editor, not part of the engine API, but it's using bezier curves and the regular line-drawing routines. Method InterpolateCurve(f:Float,x0:Int,y0:Int,x1:Int,y1:Int, px:Float Var,py:Float Var) Local curve:Float Local m:Float Local dx:Float = x1-x0 Local dy:Float = y1-y0 m=Sqr(dx*dx+dy*dy) curve = m*0.5 calcbezier f,x0,y0,x0+curve,y0,x1,y1,x1-curve,y1,px,py EndMethod Function CalcBezier(f#,x1:Float,y1:Float,vx1:Float,vy1:Float,x2:Float,y2:Float,vx2:Float,vy2:Float,px# Var ,py# Var) Local t:Float,lx:Float,ly:Float Local pointx:Float,pointy:Float Local steps:Float=20 'For Local i:Int=0 To steps+1't#=0 To 1 Step 0.25'0.05 't=1.0/(steps+1)*Float(i) t=f pointx# = x1*(1.0-t)^3.0 + 3.0*vx1*(1.0-t)^2.0*t + 3.0*vx2*(1.0-t)*t^2.0 + x2*t^3.0 pointy# = y1*(1.0-t)^3.0 + 3.0*vy1*(1.0-t)^2.0*t + 3.0*vy2*(1.0-t)*t^2.0 + y2*t^3.0 px=pointx py=pointy 'Next EndFunction Method DrawCurve(x0:Int,y0:Int,x1:Int,y1:Int) Local curve:Float Local m:Float Local dx:Float = x1-x0 Local dy:Float = y1-y0 m=Sqr(dx*dx+dy*dy) curve = m*0.5 drawbezier x0,y0,x0+curve,y0,x1,y1,x1-curve,y1 EndMethod Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Vida Marcell Posted December 10, 2021 Author Share Posted December 10, 2021 7 hours ago, Josh said: The flowgraph code is part of the editor, not part of the engine API, but it's using bezier curves and the regular line-drawing routines. Method InterpolateCurve(f:Float,x0:Int,y0:Int,x1:Int,y1:Int, px:Float Var,py:Float Var) Local curve:Float Local m:Float Local dx:Float = x1-x0 Local dy:Float = y1-y0 m=Sqr(dx*dx+dy*dy) curve = m*0.5 calcbezier f,x0,y0,x0+curve,y0,x1,y1,x1-curve,y1,px,py EndMethod Function CalcBezier(f#,x1:Float,y1:Float,vx1:Float,vy1:Float,x2:Float,y2:Float,vx2:Float,vy2:Float,px# Var ,py# Var) Local t:Float,lx:Float,ly:Float Local pointx:Float,pointy:Float Local steps:Float=20 'For Local i:Int=0 To steps+1't#=0 To 1 Step 0.25'0.05 't=1.0/(steps+1)*Float(i) t=f pointx# = x1*(1.0-t)^3.0 + 3.0*vx1*(1.0-t)^2.0*t + 3.0*vx2*(1.0-t)*t^2.0 + x2*t^3.0 pointy# = y1*(1.0-t)^3.0 + 3.0*vy1*(1.0-t)^2.0*t + 3.0*vy2*(1.0-t)*t^2.0 + y2*t^3.0 px=pointx py=pointy 'Next EndFunction Method DrawCurve(x0:Int,y0:Int,x1:Int,y1:Int) Local curve:Float Local m:Float Local dx:Float = x1-x0 Local dy:Float = y1-y0 m=Sqr(dx*dx+dy*dy) curve = m*0.5 drawbezier x0,y0,x0+curve,y0,x1,y1,x1-curve,y1 EndMethod I know that, that is why i was asking, so thanks Josh Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.