Skip to main content

Questions tagged [clipping]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
40 views

Lower Near Clipping Plane

I've searched everywhere and can't really find a good answer... Even with my near clipping plane set to 0.01 the objects are clipping too close. Tried to get a view where you can see it clipping a ...
Mashimaro7's user avatar
0 votes
0 answers
33 views

How to implement and understand Clipping

I am writing a 3D renderer from scratch in Python using PyGame and Numpy. I have the basics implemented, which are working well. I have noticed that when you get too near to objects, the objects ...
Matthew Haywood's user avatar
1 vote
1 answer
190 views

What's the purpose of this cross product and dot product in triangle clipping code?

I have this code that inserts a triangle into the drawing list. The PHD_VBUF structure stores one x,y,z vertex. If the vertex is behind the front plane, then ...
black4's user avatar
  • 205
2 votes
2 answers
575 views

Orthogonal Camera Clip/Hide part of 3D model

How to prevent the Camera from Clipping/Hiding part of the 3D Model/Object? I tried playing around with ...
Abanoub's user avatar
  • 239
0 votes
0 answers
125 views

Clipping walls in Doom-style FPS view

I have two points representing a line, and a player position. I translated and rotated the points around the player, and this works just fine. Next I want to clip the resulting line like Bisqwit did ...
LogicTheorist's user avatar
0 votes
0 answers
62 views

How to prevent Rigidbodies with restricted movement from clipping

My player is a rigidbody cube with a box collider that can push other "NPC" rigidbody cubes that also have a box collider. These NPC cubes have restricted movement either in horizontal or ...
Liisjak's user avatar
1 vote
1 answer
516 views

Geometric clipping of triangles intersecting near plane

I was reading about how rasterization works but there is one topic I can't quite understand. After perspective projection, our point is in clip space as I understand it. Now we test all points in a ...
Argus Kos's user avatar
0 votes
1 answer
33 views

Player clips into the ground when I press the restart button

The title says it all. I have a subway surfers like game prototype, where I just added a restart button that can reload the scene. However whenever I press restart the charaters gets into a slightly ...
Cserni Sándor's user avatar
1 vote
1 answer
617 views

Render only a cross-section of a 3D scene in Godot

I'm working on a 3D game where I sometimes want to display only a cross-section of the scene. Ideally I would like this to be just the intersections of the scene with a plane. But the only way I've ...
thesquaregroot's user avatar
-1 votes
1 answer
880 views

Calculate the near clip plane distance in meters from a certain object - Unity

How do you convert the near clip plane and far clip planes to position units, to be able to find out its distance to a game object?
ina's user avatar
  • 294
1 vote
0 answers
60 views

Drawing a deferred decal when the camera clips its bounding geometry

I have a building grid effect that I decal onto my terrain using a cube that moves to follow the cursor. You can see if the camera gets too close to the cube, it gets clipped by the camera's near ...
tatsu's user avatar
  • 193
0 votes
2 answers
2k views

Unity - Apply different Near/Far clip plane value for different layer

I am Lerping the Near value of my camera, from 0 to 38, and it gives this result: change near clip plane effect As you see, it gives a nice effect. But now I would like the effect to occur only for ...
Ugo Hed's user avatar
  • 281
1 vote
1 answer
73 views

Taking cube from camera space to clip space, error in my math?

watching Ken Joy's Computer Graphics lectures on youtube. One thing I'm confused about is after he gets the cube from the camera space to clip space, from my calculations the cube doesn't look like ...
user132696's user avatar
0 votes
1 answer
101 views

Prevent Wall Clipping with Bouncing Shape

I'm currently working on a demo-type program involving bouncing objects. Currently, I have a rectangle that can bounce around the screen. When the rectangle bounces against one of the walls ...
Alex Pickering's user avatar
0 votes
1 answer
521 views

How do i prevent my player from walking through mesh collider

I have a character being moved using rigidbody.moveposition and I have an floating lowpoly island with a mesh collider. When my player walks into a steep slope or a wall, it passes right through. I ...
JoffLobster's user avatar
0 votes
0 answers
206 views

Perspective projection matrix with a non-orthogonal near plane

I'm trying to figure out a way to provide such a perspective projection matrix to a shader that the "near" plane wouldn't necessarily be orthogonal to the camera vector. More specifically, I'm ...
user3139876's user avatar
0 votes
0 answers
132 views

Why does this work in the fragment shader but not in the vertex shader?

I'm doing some model view and projection transforms in the vertex shader and I want to determine whether the current vertex will end up on the viewport or not. After searching a bit I found that ...
John Katsantas's user avatar
0 votes
1 answer
268 views

Unity - Adding a sphere volume to this shader

I'm trying to create a spherical effect around my player that when they walk into range of hidden object, it gradually renders the object. I found a shader that would work pretty well for this. When ...
nmneve's user avatar
  • 3
0 votes
1 answer
105 views

What is the relationship between clipping and the fog of war concept?

I'm currently developing a 2D top down game and recently implemented clipping. I understand clipping in a 2D top down game as rectangle or any other geometrical form which defines a viewport for the ...
LOLWTFasdasd asdad's user avatar
0 votes
1 answer
830 views

How to clip what is outside scroll view when using a custom UI element?

I have created a custom UI element (that use CanvasRenderer). Here is code : ...
tigrou's user avatar
  • 3,214
3 votes
2 answers
6k views

How to completely stop the camera from clipping into the ground

Hi I'm trying to do a basic Camera Collision in unity, for convenience, here's the entire script (I actually got most of it from someone else who wrote the comments, if that's necessary to know): ///...
B''H Bi'ezras -- Boruch Hashem's user avatar
4 votes
2 answers
2k views

Is clipping done before or after projection?

Is clipping applied after projection or before? How can it be applied after projection when a vertex is behind the camera and projected therefore mirrored? At this time I clip the triangle before ...
SeekingAnswer's user avatar
0 votes
1 answer
572 views

Clipping Effect in Toon Boom Harmony 15.0

I want to do similar effect like this tutorial Masking Effect. The tutorial using Toon Boom Studio 8, I'm using Toon Boom Harmony 15 and can't seem to find the Cliiping Effect they use in tutorial. ...
raisa_'s user avatar
  • 167
1 vote
2 answers
167 views

How to clip 3D object in projection (octants)?

In example we've wrote some code in Pascal (graph unit) which rotates 3D object in oblique frontal (dimetric) projection in all octants positioned in center of them. The projection's type: The code ...
Artfaith's user avatar
  • 141
1 vote
0 answers
52 views

Algorithm for clipping convex quadrilaterals

I'm dealing with hardware that uses quads as its polygonal primitive. Not triangles. A triangle can be expressed by setting 2 of the 4 equal to each other for a degenerate quad. For the 3D engine, I'...
mrkotfw's user avatar
  • 99
0 votes
1 answer
252 views

MonoGame - render target drawn below other sprites and in the wrong location

This seems like a simple thing but still doesn't work. So I'm trying to draw a scrollable log window (not scrolling yet) by using a RenderTarget2D. There are several bugs: The text should be drawn ...
mkkekkonen's user avatar
1 vote
0 answers
667 views

How to do Decal Clipping with OpenGL using Depth Buffer comparison?

Basically I'm already drawing decals on top of various flat surfaces and that works great. As soon as the decal approaches the edge of a surface, naturally it doesn't get clipped. Is there a way to ...
JBeurer's user avatar
  • 467
2 votes
1 answer
3k views

Finding if 2 polygons intersect using clipper library

After realising my code was pretty inefficient at checking for polygon overlaps, I've turned to a mentioned library Clipper but finding it difficult to know hot to use it for this operation. I am ...
dolyth's user avatar
  • 445
1 vote
1 answer
643 views

Should I use the X-Y-plane when using an orthographic projection in OpenGL?

I'm currently at a loss rendering a tile-based 3D map with an orthographic projection in OpenGL. Imagine any isometric 3D game (using actual geometry instead of sprites). Internally, the tiles of my ...
domsson's user avatar
  • 125
12 votes
2 answers
1k views

Details of what GPU actually do when clipping in 4D homogeneous space?

I am learning programmable rendering pipeline by implementing a tiny software renderer. I try to implement it in a 'hardware' style. However, I am not familiar with the GPU pipeline and got some ...
stanleyerror's user avatar
2 votes
0 answers
234 views

GL.Scissor not working as expected

I have some code for rendering a button in an application and I want to clip the text if it's wider than the button itself. Here a bit of code to describe what I'm doing: ...
Philippe Paré's user avatar
0 votes
1 answer
776 views

Liang-Barsky Line Clipping Algorithm

Is it possible to generalize Liang-Barsky Line Clipping Algorithm for n-dimensional space ?
john john's user avatar
  • 199
2 votes
0 answers
241 views

Custom 3D Renderer: Frustum clipping

I have recently been toying with the idea of creating a 3D-renderer from scratch and, after looking into it, doesn't seem like such a behemoth of a task as it sounds. Last night, I was tossing and ...
Mr_Rockers's user avatar
6 votes
4 answers
5k views

How to clip game objects to a rectangular area

I'm trying to figure out how to do this but am coming up short. I'm making a slot machine in unity 2d and would like to clip the tile prefabs when they leave a given rectangular area. I can't seem to ...
ReaperUnreal's user avatar
4 votes
1 answer
515 views

OpenGL: How to map point inside frustrum to normal device coordinates (NDC)?

I read this article http://www.songho.ca/opengl/gl_projectionmatrix.html. It's explain how calculate projection matrix coefficients. But I completely can't understand how author perform mapping from ...
frankWhite's user avatar
1 vote
1 answer
377 views

Does projection take place before clipping in the rendering pipeline?

At first I thought clipping happens before projection since new vertices may be added and the output of projection is in NDC which is 2D. However after a lot of googling, I found that some articles/...
EternalWind's user avatar
7 votes
2 answers
2k views

LibGDX - Show a minimap

I've started to develop a small roguelike game in LibGDX. I've also made a minimap class, which creates and updates the minimap as the player explores the dungeon, by using a ...
Rothens's user avatar
  • 453
2 votes
1 answer
952 views

Does triangle-plane clipping in 3D always produce a triangle?

When you clip a triangle against a plane, will you always get a triangle out? Are there perhaps cases where you don't get a triangle out of clipping it against a plane?
Curiosity's user avatar
  • 123
1 vote
1 answer
519 views

How to only render fragments with Z from 0 to 1 in OpenGL?

I have been using OpenGL for a year now, but I just recently found out that OpenGL only clips vertices when the absolute value of the x,y or z coordinate is less than the absolute value of w ...
Andreas's user avatar
  • 415
0 votes
1 answer
3k views

Discarding triangles in Unity

I have about 2+ years of experience in computer gaming development and I just started writing my own shaders to help me utilize performance. I have this problem that I'm trying to work around but ...
Óttar Guðmundsson's user avatar
3 votes
1 answer
257 views

How can I use CCClippingNode to trim the top and bottom from a CCTableView?

I'm fairly new to Cocos2d and struggling with sizing a CCTableView. How can its height be controlled so that I have space at the top and the bottom? I'm trying to ...
Carl Hine's user avatar
  • 141
1 vote
0 answers
254 views

Cubic bezier polygon clipping

I have a large cubic bezier defined 2D polygon area which I need to render in DX11 real-time to create as many 4096x4096 textures as needed. An average control point count would be around the 12k and ...
BezierHelpMe's user avatar
1 vote
0 answers
795 views

libgdx ScissorStack problem

Im making a user interface using libgdx I created a Window class & a Textfield class, that both use clipping. I use the ScissorStack class of libgdx for clipping. The Textfield is drawn inside ...
LeSam's user avatar
  • 268
0 votes
1 answer
2k views

Can I use clipping with Unity Sprite in NGUI?

I used NGUI free version (2.7) with Unity 4.3. I have tried to use clipping to restrict the area of viewer by using clipping to hide some content of Unity Sprite. However, it did not work. If it's ...
Paiboon Panusbordee's user avatar
2 votes
1 answer
1k views

Performing manual clipping in OpenGL

I'm learning OpenGL and I understand that OpenGL performs clipping as part of the pipeline, but is it a good idea to also perform manual clipping? By manual clipping, I mean not asking the GPU to draw ...
Izaan's user avatar
  • 145
0 votes
1 answer
672 views

How do I detect how much of an object has been "cleaned" by the player?

I want to let the player wipe some dust off of a book, then start a short animation. Here's what it looks like: I'm using a clipping region on the "dusty" book bitmap image to progressively hide the ...
user42196's user avatar
14 votes
2 answers
2k views

How do I create a World Healing Wave effect?

I want to change my dark and depressing background to a happy grassy background, in real-time, such that the happy background is shown in a radius around a game character. A forcefield of happiness, ...
Green_qaue's user avatar
  • 1,903
1 vote
2 answers
234 views

Moai: Clipping an image to a polygon

I'm using Moai SDK. I have an image and some random convex 2D polygons. I want to show only the parts of the image inside these polygons. Here's an example image: The same, shown only where the ...
noon's user avatar
  • 11
0 votes
1 answer
270 views

XNA DepthBias increases performance even when EarlyZ is turned off. Why?

My 3d scene consists of three main polygons: The first and the second polygons overlap each other (have the same World matrix and use the same geometry), the third one is perpendicular to the first ...
cubrman's user avatar
  • 1,551
3 votes
1 answer
315 views

How Do Objects Not Clip Out the Back of Thin Walls When Put Through a Portal?

In Portal or Portal 2, let's say you pick up a cube and put it most of the way through a portal on a very thin wall. The cube should clip outside the backside of the wall. How does Portal do this, or ...
Keavon's user avatar
  • 849