Discuss the development of new homebrew software, tools and libraries.
	Moderators:  cheriff , TyRaNiD 
			
		
		
			
				
																			
								LuMo 							 
									
		Posts:  410 Joined:  Sun Aug 21, 2005 2:45 amLocation:  Austria
				Contact: 
				
			 
				
		 
		
						
					
													
							
						
									
						Post 
					 
								by LuMo  Wed Jun 07, 2006 7:52 pm 
			
			
			
			
			i know it was in this forum some time ago (think i even helped out :) )
but somehow i screwed it up...
u32 is my color (as used everywhere when it comes to psp...)
i try to extract the values this way:
				iA = ((mesh.verticesV1.color>>24) & 255);.color >> 16) & 255);.color >> 8) & 255);.color & 255);    
"Good artists copy, great artists steal." 
Pablo Picasso 
go2lumo.com  
		 
				
		
		 
	 
				
		
		
			
				
								Raphael 							 
									
		Posts:  646 Joined:  Tue Jan 17, 2006 4:54 pmLocation:  Germany
				Contact: 
				
			 
				
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by Raphael  Wed Jun 07, 2006 8:26 pm 
			
			
			
			
			nothing, but what do you actually get? all zeros?
			
			
									
									
						 
		 
				
		
		 
	 
				
		
		
			
				
																			
								LuMo 							 
									
		Posts:  410 Joined:  Sun Aug 21, 2005 2:45 amLocation:  Austria
				Contact: 
				
			 
				
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by LuMo  Wed Jun 07, 2006 8:32 pm 
			
			
			
			
			Code: Select all 
	int iA, iR, iG, iB = 5;
      	float fA, fR, fG, fB;
	iA = ((mesh.verticesV3[i].color>>24) & 255);
	iB = ((mesh.verticesV3[i].color >> 16) & 255);
	iG = ((mesh.verticesV3[i].color >> 8) & 255);
	iR = (mesh.verticesV3[i].color & 255);
			    	
      	fA = abs(iA / 255);
      	fB = abs(iB / 255);
      	fG = abs(iG / 255);
      	fR = abs(iR / 255);
 
        printf("%f %f %f %f %f %f %f\n", fA, fB, fG, fR, mesh.verticesV3[i].x, mesh.verticesV3[i].y,
               mesh.verticesV3[i].z);
this is my full code...
so what i input is a value like 0xFFFEFFB4
should bring up values in int:
255, 254, 255, 180
which results in
1, 0.996078, 1,  0,705882
what i get is
1, 0, 1, 0
lumo
ps: does abs round? (did not think about this before :D )
"Good artists copy, great artists steal." 
Pablo Picasso 
go2lumo.com  
		 
				
		
		 
	 
				
		
		
			
				
																			
								white rabbit 							 
									
		Posts:  60 Joined:  Wed Jul 06, 2005 7:03 pm 
		
						
					
						 
													
							
						
									
						Post 
					 
								by white rabbit  Wed Jun 07, 2006 8:43 pm 
			
			
			
			
			You may want to change the:.0 );
			
			
									
									
						 
		 
				
		
		 
	 
				
		
		
			
				
																			
								LuMo 							 
									
		Posts:  410 Joined:  Sun Aug 21, 2005 2:45 amLocation:  Austria
				Contact: 
				
			 
				
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by LuMo  Wed Jun 07, 2006 8:51 pm 
			
			
			
			
			not possible....
			
			
									
									"Good artists copy, great artists steal." 
Pablo Picasso 
go2lumo.com  
		 
				
		
		 
	 
				
		
		
			
				
								Raphael 							 
									
		Posts:  646 Joined:  Tue Jan 17, 2006 4:54 pmLocation:  Germany
				Contact: 
				
			 
				
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by Raphael  Wed Jun 07, 2006 8:58 pm 
			
			
			
			
			no, fabs should do what you want. However you normally shouldn't need to abs your values, since the i* values will always be positive.
			
			
									
									
						 
		 
				
		
		 
	 
				
		
		
			
				
																			
								LuMo 							 
									
		Posts:  410 Joined:  Sun Aug 21, 2005 2:45 amLocation:  Austria
				Contact: 
				
			 
				
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by LuMo  Wed Jun 07, 2006 9:02 pm 
			
			
			
			
			thanks! works now!
			
			
									
									"Good artists copy, great artists steal." 
Pablo Picasso 
go2lumo.com  
		 
				
		
		 
	 
				
				
		
		
			
				
																			
								LuMo 							 
									
		Posts:  410 Joined:  Sun Aug 21, 2005 2:45 amLocation:  Austria
				Contact: 
				
			 
				
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by LuMo  Fri Jun 09, 2006 7:04 pm 
			
			
			
			
			yes
			
			
									
									"Good artists copy, great artists steal." 
Pablo Picasso 
go2lumo.com