With hepl of my friend Woody i make a new function for
check normal from a created face:
fn isFliped poly_obj the_face =
(
local v1 = (mapScreenToWorldRay mouse.pos).dir
local v2 = (normalize (polyOp.getFaceNormal poly_obj the_face))
if (dot v1 v2) > 0 then return true else return false
)
Beware! Working only for interactive polygon creation.
I think merlinEL is on the right track here . how are you getting on with the scanner arm ?
normally you would have a list of vertices (x,y,z) followed by a list of face points (what vertex is used by each face?)
for instance:
vertex1 = 100,100,100
vertex2 = 150,150,150
vertex3 = 200,200,200
followed by the index for the face
1,2,3
therefor a poly would be created using those vertices.
From your example I take it the faces are created in that order: line1 = vertex1 x,y,z and also the 1st point for your face?
Hi Lolec,
Assuming you have 3ds Max I would start first by exporting object data from Max. There’s a ” “How-to” in the MAXScript Reference. It can be found under How-to-practicle examples-> How To … Output Object Data To File. There is also a section under the same How-to section that tells specifically How To … Read/Write Geometry Data From/To Text File. Then I would read the How-to How To … Create Scripted Geometry Plug-in. Then you could store all your scans in the Max text format and create them with your plugin with a push of a button or by script. I think all the info you need is already outlined more than adequately in the how-to section so there’s no real reason to go into it. An excellent option would be to dynamically create buttons for your objects as new text/objects are added.
Sounds like a very interesting project. Enjoy it while it lasts.
Cheers,
Bill
ok, i think im going into the right direction. 1 questions now.
1.- is it possible to take the data from a text file and update the spline or object ? i mean i can update the text file continiusly, so if max can take that as well and update the created object wold be awsome.
Only way I can think of to do this would be to add a timer in your script and do something like “on clock tick do (function)” Depending on how CPU intensive your script is you could run the function every milisecond.
rollout clockroll "Angle Test"
(
Angle angH "Angle 1" diameter:50 align:#left startdegrees:270 dir:#cw color:black across:3
Angle angM "Angle 2" diameter:50 align:#center startdegrees:270 dir:#cw color:gray
Angle angS "Angle 3" diameter:50 align:#right startdegrees:270 dir:#cw color:white
Timer clock "Time"
local var1=0 as float
on clock tick do
(
local x = cos 90+ var1 as float
angH.radians = (x as float)/720
angM.radians = (x as float)/60
angS.radians = x as float
var1 = x +(pi/30) as float
if var1 == 360 then var1 = 0
)
)
createdialog clockroll 200 110
Hope that helps.
Bill
I dont think you can do it automatically, the only way to do that would be to scan through the file and compare it with the object data already created. If the polygon count and order doesnt change that should be achievable.
BTW, I’ve been doing some tests with your example and have it loading and creating an object from it. Am I right in thinking that the 1st 3 lines is all the data for the 1st face and the next 3 are for the next face?
i think you will need 4 lines in order to create a 4 sides ploygon. i recomend you to check this video.
http://www.cmlcreative.com/Videos/PolyBoost2_video.avi
cool :)! so now it imports an object each second. the same object. the script can compare the data from the last imported object and just edit it to match the new information ? i mean like update the model. or it have to erase the last one and create a new. that would be sloow
If you don’t want to post your code here you could send it to me by email available in my profile or you can send it via private message. However I’m going to take a stab at your problem first without actually looking at the code.
Try:
redrawViews()
at the end of, and inside, your loop that calls for the new data.
Hope that helps as well.
Bill
…but my english is to bad.
If you can explane it more clearly. Using some video or pictures…