2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
[???] View-Frustum
#379037
07/28/11 21:02
07/28/11 21:02
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
OP
Senior Member
|
OP
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
Hi
I have a question about the view-frustum.
with " my.clipfactor = 999999; " the entity never clips away. but is this true?
999999 is for shure the distance from the camera to the end of the view-frustum. So if a opbject has a distance > than 999999 it clips also away again... am i right?
And another problem: if i use "my.clipfactor" with a value > than 9, the object is invisible.... Is there a rule in how to use my.clipfactor?
Last edited by maslone1; 07/30/11 07:07.
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: [???] View-Frustum
[Re: maslone1]
#379186
07/30/11 07:11
07/30/11 07:11
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
OP
Senior Member
|
OP
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
OK.
Nobody answered, so i've tested it out by myself.
The answere: a clipfactor of 999'999 is the maximum.
I've tried to use a higher value, but if i use for instanve 999'999'999 every object clips away from the beginning.
SO this is my question now: Is there any way to use a higher value for the view-frustum?
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: [???] View-Frustum
[Re: maslone1]
#379187
07/30/11 07:31
07/30/11 07:31
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
You are limited by the the data type of the clipfactor which is var, so 1048576 is the maximum.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: [???] View-Frustum
[Re: WretchedSid]
#379188
07/30/11 07:44
07/30/11 07:44
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
OP
Senior Member
|
OP
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
I see.
You're right JustSid
SO is there any chance to change the data-type for the view-frustum in lite-c? For instance to long or double?
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: [???] View-Frustum
[Re: maslone1]
#379190
07/30/11 08:39
07/30/11 08:39
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
OP
Senior Member
|
OP
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
Usual i would use the cast-operation.
But what is the right name of the variable for the view-frustum so i can use the cast-operation?
??? int view-frustum = xxxx ???
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: [???] View-Frustum
[Re: maslone1]
#379197
07/30/11 10:48
07/30/11 10:48
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Nope, you can't change it to double. You can cast a double to var using explicit type casting but then you had a var and not a double meaning that you are still limited by the range of a var.
Btw, just for your interest, a double is in Lite-C a 32 bit floating point variable, not a double precision floating point.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: [???] View-Frustum
[Re: maslone1]
#379203
07/30/11 11:23
07/30/11 11:23
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
So if a opbject has a distance > than 999999 it clips also away again... am i right? No, that's not completely true. Take for example an object that has a size of 100 quants (size = radius of a sphere around the origin of the entity that completely surrounds it). Imagine, the entity is on the right-hand side of the view but not on the screen. If the origin of the entity is closer than 100 quants to the right plane of the view frustum, it will be rendered. The entity variable clipfactor multiplies the size of the entity and uses that value in the visiblity check mentioned above (distance to plane closer than 100*clipfactor?). SO is there any chance to change the data-type for the view-frustum in lite-c? [...] But what is the right name of the variable for the view-frustum so i can use the cast-operation? What variable are you talking about, clipfactor (or camera.clip_far)? clipfactor is only defined for entities:
typedef struct ENTITY {
C_LINK link;
char *type; // entity file name
var x,y,z; // position of the entity
...
void* body; // physX actor
var clipfactor; // visual clipping factor
} ENTITY;
You see, as JustSid already mentioned, the data type is var and cannot be changed. I assume you are looking for something different, maybe a sky entity (that's a view entity with SKY or SCENE flag)?
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: [???] View-Frustum
[Re: Superku]
#379229
07/30/11 18:00
07/30/11 18:00
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
OP
Senior Member
|
OP
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
i was looking for the var camera.clip_far.
But OK,... i already found it in the VIEW struct. I already changed the type of clip_far from var to int in the atypes.h file. Now it works, ....but for now with another little bug. I'll try to fix the "new" bug....
thanks again!
Last edited by maslone1; 07/30/11 18:01.
A8c, Blender, FlStudio, Unity3d
|
|
|
Re: [???] View-Frustum
[Re: maslone1]
#379230
07/30/11 18:01
07/30/11 18:01
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
The header file is completely informational (for you and Mr. Compiler)! Changing the struct there will have no difference at runtime!
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: [???] View-Frustum
[Re: WretchedSid]
#379232
07/30/11 19:02
07/30/11 19:02
|
Joined: Jul 2007
Posts: 424 EUROPE
maslone1
OP
Senior Member
|
OP
Senior Member
Joined: Jul 2007
Posts: 424
EUROPE
|
interesting... my falt again. there must be another reason for the higher value i am able to use (ca. 2'095'000) i've changed the type to "long". there are some changes in the handle of values. But you're right again JustSid. The maximum value does not change But now it is interesting for me, why i can use a camera.clip_far value of 2 x 1048577.999 (ca. 2'095'000) the value should just work from -1048577.999 to +1048577.999 but ok. i accept the fact it is not changeable I do not understand, why the view-frustum must have the typ var??? For small worlds, and indoor games it is fine. But for big worlds it would be nice to change the typ to int or long.
A8c, Blender, FlStudio, Unity3d
|
|
|
|