scale and real world metrics question

Nov 25, 2010 at 11:23 AM
Edited Nov 25, 2010 at 11:24 AM

Hi Einar, here at SVS i'm trying to simplify the way our 3dobjects gets scaled.

Currently i calculate the maximal dimension from my 3dobjects and then

i divide all the vertices coordinates with this maximal dimension.

This results in standard sized 3dobject all with the size of 1, even though bridges, buildings and flightwings are not the same real world sizes !

But this evenly sized 3dobject is way to small when rendered to the screen.

Therefore i scale the 3dobjects with _geometry.Scale prop when loading the 3dobjects.

but calculating the Scale prop is a little messy because i use "anti aliasing" doing double game size with renderTransform = 0.5

a great trick i think :-)

but now the scale doesn't adjust correct anymore, resulting in half sized 3dobject

Would there be anyway to resize game without having to use scaling, considering my situation

where i always render standard sized 3dobjects ?

 

Coordinator
Nov 25, 2010 at 7:03 PM

You kinda lost me halfway through here.

You're normalizing the geometries. Then you're scaling the game with rendertransform - which gives you anti-aliasing. 

Then you get wrong sized 3D objects. 

 

I'm not sure how these things are related. Is it possible for you to send me some screenshots by email and explain what you're trying to accomplish more in detail. 

Nov 26, 2010 at 8:37 AM

yes almost correct,

1. i normalise the geometries (max dimension always 1)

2. just after geometries creation i use geometry.Scale = new Point(800,800,800)
because the  normalized  geometry  is way to small to see on rendered screen - even with camera distance -1 !

(i'm using Orthographic camera for best performance on xp pc and silverlight platform.
I have recently realized that standart Balder.View.Camera is resizeing geometry ok, so i think this is an bug  in Orthographic camera !)

3. after implementing "virtual anti aliasing", the Scale property seems to be ignored !!
resulting in 3dgeometry half sized.


Coordinator
Nov 28, 2010 at 7:57 AM

I'm still not getting the 3rd point (sorry for being slow). When you say "virtual anti aliasing" and scaling. You're scaling the game with a RenderTransform. Meaning you have a much larger Game (Width + Height set to a lot bigger than you want, and scale it down for anti-aliasing). I don't see how the Scale property of a Geometry can be ignored at this point.

This might be a problem, as you point out, with a bug in the orthographic camera.

Could you try setting the Games width and height to the size you actually want and see if the scaling is still ignored.

Nov 29, 2010 at 7:47 AM

I personaly think you are a master blaster programmer anyway Einar :-)

yes i render 2 x normal size and then use renderTransform.

if i use a normal Camera (with perspective) it's possible to adjust 3dobject screensize by adjusting camera distance !
thereby omitting geometry.Scale property :-)

With normal camera i simply  render 2 X game.width , height and do renderTransform - this is not possible with orthographic camera unfortunately.

because with Orthographic camera i have to use geometry.Scale property in order to see anything.
because i'm a sort of newbie to 3d programming i didn't realize that this behavior might be a bug.

When i set the game width and height to the actual size,  geometry.Scale is working perfect !

Coordinator
Nov 29, 2010 at 11:16 AM

:) Thanks. 

 

I'll put Orthographic Camera up for a review, it is not acting out as I'd hope. It was a bit of a rushed feature, so I'm not surprised its blowing up in my face now.. :)

Coordinator
Nov 29, 2010 at 11:17 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Dec 7, 2010 at 7:45 AM

thank again