c# - Save cube in variable and apply scale/rotate/move OpenTK -
i creating simple 3d editor. can draw simple primitives cube but, don't know how save object som variable , copy other coordinates. don't know how rotate/scale/move cube , save new shape variable. have seen many tutorials on topic, in every 1 them, guy moving camera, not drawn object(cube). need tutorial how save object variable, load object variable , draw many times on different coordinates on scene , apply transformation these new objects(move,rotate,scale). creating app in c# , opentk
use gl.translate(x,y,z)
, gl.rotate(θ,x,y,z)
, gl.scale(sx,sy,sz)
functions move coordinate system origin, orientation , scaling.
so drawing cube after command
gl.translate(10,10,100);
will draw cube @ above location. here (clunky) example of process below:
Comments
Post a Comment