Cuneyt Ozdas Forum
Cuneyt Ozdas Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 English - General
 Software Support
 A novice question on MaxScript
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

wilson_asdf
Starting Member

Australia
2 Posts

Posted - 28/07/2006 :  12:02:00  Show Profile
Hi All,

I am still a newbie on using 3D studio max software, as well as MaxScript. And I have this problem: Given that I have a model of a person, and I would like to capture that model from different point of view, i.e. by rotating the camera 360 degrees, I would like to save its view of the model into ##.jpg files. But I am not sure how I can do it in MaxScript. As my later task is: I have a dozen models, and each model I wish to be able to generate at leasts 20-30 jpg (image) files.

In short, my problem would simply be written as:
1. First, I need to know how to rotate 360 degrees of my current camera in 3D view with respect to the object (model)
2. Next, is how to capture (automatic render) the current view of the object and save it as a jpg file.

Does anyone have a clue? Please advice. I really appreciate for the help

Thank you,
Wilson

wilson_asdf
Starting Member

Australia
2 Posts

Posted - 30/07/2006 :  08:41:25  Show Profile
Hi All,

First of all, I have managed to write a script to solve my initial problem. But now I have one question, regarding the creation of a camera. Basically I wrote a sript that does the following tasks:
1. It will read a directory name as an input, and load all the *.max objects.
2. I then group all the objects together into Group01
3. Next I create a camera (from the current view) ??? the position is hard-corded
4. and then rotate the Group01 using eulerangles method
5. Render and save it

From the script above I get the expected results, which is good, but I only have another question to complete the automation of my script, i.e. I hard coded my camera's position on the script (at the step 3 above). The following are portion of the codes

cam = targetCamera showCone:True target:(targetObject pos:[-0.03687,-0.677,0.517])
$Camera01.pos = [-0.085,-1.791,0.816]

Basically, the script is aim to target for the Group01 object. And the parameters (number) I assigned above is taken from the experiments. I have tried various of ways to position the camera and its target view, and the best result always come from creating the "camera from view". Others will produce a black dark image, I suppose the camera isn't pointing to the correct target's position and causing the lighting to become dark.

I wish to automate the position of the camera, i.e. to create a camera from current view (In studio 3ds max 6, the shortcut key is "Ctrl + C" or its under the "Create" menu -> Camera -> Create Camera from view.), but I don't know which syntax I would use to create that. Does anyone has a clue on this problem? Please advice. Thank you.

Regards,
Wilson
Go to Top of Page

Admin
Forum Admin

Turkey
649 Posts

Posted - 04/08/2006 :  01:41:30  Show Profile  Visit Admin's Homepage
Hi,
you can try positioning the camera target to the center of the Group01. Something like this:

cam = targetCamera showCone:True target:(targetObject pos:$Group01.center)


also similarly can try placing the camera away from the objects far enough using the size information of the Group01 object. Depending on the camera fov you need to find a proper multiplier. I mean something like this:


size = $Group01.max - $Group01.min
max_size = amax #(size.x, size.y, size.z)
$Camera01.pos = $Group01.center + [3*max_size, 0, 0]


this places the camera away from the target node in X direction at a distance 3 times the scene size. camera looks paralel to the ground (target and camera has the same z).

I'm not a max scripter myself, so the code I give here may not work at all. But I hope it gives some ideas.

/Cuneyt
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Cuneyt Ozdas Forum © 2000 - 2003 Cuneyt Ozdas Go To Top Of Page
This page was generated in 0.08 seconds. Snitz Forums 2000