[Closed] Mini-Challenge #2
we can continue the discussion about this challenge
but are you ready to take up a new one?
woah! cool thread! It is way out of my league, though.
But I think you could take it up a notch, what about PN triangle tessellation?
As far as I know it’s one of the tessellation methods that can be used with DirectX11, would be interesting to be able to apply the same tessellation in 3dsmax.
More info here (scroll down). You can also download an exporter with the source from the same website.
the algorithmic part of the code is really short. it’s only 23 lines of code:
fn tesselateKeepNormalsLite node:selection[1] tension:0 type:0 iterations:0 = if iskindof node Editable_poly do
(
setCommandPanelTaskMode mode:#modify
select node
NORM_CH = 5
polyop.setMapSupport node NORM_CH on
polyop.defaultMapFaces node NORM_CH
polyOp.applyUVWMap node #face channel:NORM_CH
modpanel.addmodtoselection (norm = edit_normals displayLength:0)
for f=1 to norm.GetNumFaces() do
(
corners = polyop.getMapFace node NORM_CH f
for c=1 to corners.count do
(
id = norm.GetNormalID f c
polyop.setMapVert node NORM_CH corners[c] (norm.GetNormal id)
)
)
modpanel.addmodtoselection (tess = tessellate tension:tension type:type iterations:iterations faceType:1)
modpanel.addmodtoselection (modi = edit_normals displayLength:0)
disableRefMsgs()
for f=1 to modi.GetNumFaces() do
(
verts = polyop.getMapFace node NORM_CH f
for c=1 to verts.count collect
(
id = modi.GetNormalID f c
modi.SetNormal id (polyop.getMapVert node NORM_CH verts[c])
)
)
modi.MakeExplicit selection:#{1..modi.GetNumNormals()}
enableRefMsgs()
converttopoly node
)
all other is tricks to make it specifically faster.
I don’t see why there should ever be a limit to the number of lines in code, surely that’s an unrealistic target to set. Just think of a nice simple challenge that can be written many ways
there is no limit of lines of code for solution !!! … I said I want to find challenges with minimum coding.
New challenge idea? http://forums.cgsociety.org/showpost.php?p=7002394&postcount=4