POV-Ray : Newsgroups : povray.newusers : Modify imported .obj in POV-Ray Server Time
23 Nov 2024 15:01:45 EST (-0500)
  Modify imported .obj in POV-Ray (Message 1 to 4 of 4)  
From: Newbie
Subject: Modify imported .obj in POV-Ray
Date: 1 Sep 2013 10:30:01
Message: <web.52234f0835399cf3a2d646340@news.povray.org>
Hi, I'm new to POV-Ray so not good at it.
I managed to import .obj into POV-Ray using PoseRay program but the imported
object are so huge for my scene so I am trying to scale it down. I can't seem to
find out how to scale the object down so it fit in my scene (since there like so
much code in the geom.inc file). I tried to search around but can't seem to find
anything. So could anyone guide me to scale/translate the imported .obj so I
could use for my POV-Ray please?

Thanks


Post a reply to this message

From: Newbie
Subject: Re: Modify imported .obj in POV-Ray
Date: 1 Sep 2013 10:45:01
Message: <web.522351df5b4622dda2d646340@news.povray.org>
"Newbie" <nomail@nomail> wrote:
> Hi, I'm new to POV-Ray so not good at it.
> I managed to import .obj into POV-Ray using PoseRay program but the imported
> object are so huge for my scene so I am trying to scale it down. I can't seem to
> find out how to scale the object down so it fit in my scene (since there like so
> much code in the geom.inc file). I tried to search around but can't seem to find
> anything. So could anyone guide me to scale/translate the imported .obj so I
> could use for my POV-Ray please?
>
> Thanks

NVM! Sorry everyone...I just realised how dumb I was :( - Thinking scaling down
by multiplying by negatives values...Just realised that after I post this.

Sorry for dumb post.


Post a reply to this message

From: Fractracer
Subject: Re: Modify imported .obj in POV-Ray
Date: 1 Sep 2013 10:50:01
Message: <web.5223540b5b4622dde9f5ed2c0@news.povray.org>
"Newbie" <nomail@nomail> wrote:
> Hi, I'm new to POV-Ray so not good at it.
> I managed to import .obj into POV-Ray using PoseRay program but the imported
> object are so huge for my scene so I am trying to scale it down. I can't seem to
> find out how to scale the object down so it fit in my scene (since there like so
> much code in the geom.inc file). I tried to search around but can't seem to find
> anything. So could anyone guide me to scale/translate the imported .obj so I
> could use for my POV-Ray please?
>
> Thanks

To scale down an object you have to insert, for example: scale <0.5,0.5,0.5> in
the object section will scale down the object by 2.
In your main file scene you must have: #include geom.inc
and after you have to call the object that you need (ex: if your object's name
is FOO): object{FOO scale <0.5,0.5,0.5>}


Post a reply to this message

From: Alain
Subject: Re: Modify imported .obj in POV-Ray
Date: 1 Sep 2013 17:01:46
Message: <5223ab3a$1@news.povray.org>

> Hi, I'm new to POV-Ray so not good at it.
> I managed to import .obj into POV-Ray using PoseRay program but the imported
> object are so huge for my scene so I am trying to scale it down. I can't seem to
> find out how to scale the object down so it fit in my scene (since there like so
> much code in the geom.inc file). I tried to search around but can't seem to find
> anything. So could anyone guide me to scale/translate the imported .obj so I
> could use for my POV-Ray please?
>
> Thanks
>
>

To scale down, you use a fractional value.
Using a negative value will mirror your shape on that axis.

Be warned that ALL scale and rotate are performed relative to the 
origin: <0,0,0>.
If the object is NOT at/around the origin, scaling will move the object 
radialy, and a rotation will cause it to orbit the origin.

If you want to adjust the size of an object of unknown size and location 
to a known size and location, you can use:

#declare Min=min_extent(Object);
#declare Max=max_extent(Object);

to get the bounding box of Object.

Then, use:
#declare Object={Object translate -(Min+Max)/2}

to redefine your object around the origin.

Then:
#declare Max=max_extent(Object);
#declare Object={Object scale 1/Max}

to redefine your object to fit an unit box.

Now, Object fit exactly inside a box{<-1,-1,-1>,<1,1,1>}
You can now scale it to exactly the dimention you want.
Once properly scaled, you can rotate and translate it to where you 
need/want.


Alain


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.